Class: Inspec::FetcherRegistry
Constant Summary
collapse
- NON_FETCHER_KEYS =
[:name, :version_constraint, :cwd, :backend, :cache, :sha256].freeze
Instance Attribute Summary
#registry
Instance Method Summary
collapse
#initialize
Constructor Details
This class inherits a constructor from PluginRegistry
Instance Method Details
#fetcher_specified?(target) ⇒ Boolean
19
20
21
22
23
24
25
|
# File 'lib/inspec/fetcher.rb', line 19
def fetcher_specified?(target)
return true if !target.respond_to?(:keys)
!(target.keys - NON_FETCHER_KEYS).empty?
end
|
#resolve(target) ⇒ Object
9
10
11
12
13
14
15
16
|
# File 'lib/inspec/fetcher.rb', line 9
def resolve(target)
if fetcher_specified?(target)
super(target)
else
Inspec::Log.debug("Assuming default supermarket source for #{target}")
super(with_default_fetcher(target))
end
end
|
#with_default_fetcher(target) ⇒ Object
27
28
29
|
# File 'lib/inspec/fetcher.rb', line 27
def with_default_fetcher(target)
target.merge({ supermarket: target[:name] })
end
|