Class: MetadataJsonDeps::ForgeVersions

Inherits:
Object
  • Object
show all
Defined in:
lib/metadata_json_deps.rb

Instance Method Summary collapse

Constructor Details

#initialize(cache = {}) ⇒ ForgeVersions

Returns a new instance of ForgeVersions.



6
7
8
# File 'lib/metadata_json_deps.rb', line 6

def initialize(cache = {})
  @cache = cache
end

Instance Method Details

#get_module(name) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/metadata_json_deps.rb', line 10

def get_module(name)
  name = PuppetForge::V3.normalize_name(name)
  begin
    @cache[name] ||= PuppetForge::Module.find(name)
  rescue Faraday::ResourceNotFound
    raise PuppetForge::ModuleNotFound.new("Dependency #{name} not found on forge.puppet.com")
  end
end