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 depend.resolve();
    }
    
    static String hostedCacheDir() {
      var path = baseCacheDir();
      return Path.join(path, "hosted");
    }
    
    static String baseCacheDir() {
      var path;
      var home = Platform.environment['PUB_CACHE'];
      if (home != null) {
  
negative.code: }
  
  class _PubHost {
  
    final String name;
    final String path;
    final List<Package> packages;
    
    _PubHost(this.name, this.path, this.packages);
    
    static _PubHost resolveHost(String dir, String host) {
      var hosted = Path.join(dir, host);
      var packages = <Package>[];
      if (FileSystemEntity.isDirectorySync(hosted)) {
        var hostDir = new Directory(hosted);
  