lib/ronin/platform/platform.rb in ronin-0.2.1 vs lib/ronin/platform/platform.rb in ronin-0.2.2

- old
+ new

@@ -94,13 +94,24 @@ # # _options_ may contain the following key: # <tt>:media</tt>:: The media of the overlay. # def Platform.install(options={},&block) - options = options.merge(:into => OverlayCache::CACHE_DIR) + unless options[:uri] + raise(ArgumentError,":uri must be passed to Platform.install",caller) + end - Repertoire.checkout(options) do |path,media,uri| - return Platform.add(:path => path, :media => media, :uri => uri) + uri = options[:uri].to_s + host = (URI(uri).host || 'localhost') + host_dir = File.join(OverlayCache::CACHE_DIR,host) + options = options.merge(:into => host_dir) + + Repertoire.checkout(options) do |repo| + return Platform.add( + :path => repo.path, + :media => repo.media_name, + :uri => uri + ) end end # # Updates all previously installed overlays. If a _block_ is given