anchor.diff:  
   class Pub {
     
  +  final String cacheDir;
     final Map<String, _PubHost> _hosts;
   
     /**
      * [cache] is the path to the cache directory. The default being
      * the retrieved path from cacheDir()
      */
  -  factory Pub() {
  -    var hosts = _PubHost.resolveAllHosts();
  -    return new Pub._internal(hosts);
  +  factory Pub({String cacheDir}) {
  +    if (cacheDir == null) cacheDir = _baseCacheDir();
  +    var hosts = _PubHost.resolveAllHosts(cacheDir);
  +    return new Pub._internal(cacheDir, hosts);
     }
     
  -  Pub._internal(this._hosts);
  +  Pub._internal(this.cacheDir, this._hosts);
   
     /**
      * Resolves a hosted package.
  
positive.code:     return new _PubHost(host, hosted, packages);
    }
    
    static Map<String, _PubHost> resolveAllHosts() {
      var hosts = <String, _PubHost>{};
      var hosted = Pub.hostedCacheDir();
      if (FileSystemEntity.isDirectorySync(hosted)) {
        new Directory(hosted).listSync(followLinks: false).forEach((hostEntity) {
          var baseName = Path.basename(hostEntity.path);
          hosts[baseName] = resolveHost(baseName);
        });
      }
      return hosts;
    }
  }
  
  
negative.code:     return depend.resolve();
    }
    
    static String _baseCacheDir() {
      var path;
      var home = Platform.environment['PUB_CACHE'];
      if (home != null) {
  