remote_asset_cache

in src/_plugins/asset_bundler.rb [276:297]


    def remote_asset_cache(uri)
      cache_file = File.join(cache_dir(),
                             "remote.#{Digest::MD5.hexdigest(uri.to_s)}.#{@type}")
      content = ""

      if File.readable?(cache_file)
        content = File.read(cache_file)
      else
        begin
          puts "Asset Bundler - Downloading: #{uri.to_s}"
          content = Net::HTTP.get(uri)
          File.open(cache_file, "w") {|f|
            f.write( content )
          }
        rescue
          puts "Asset Bundler - Error: There was a problem downloading #{f}\n  #{$!}"
        end
      end

      return content
    end