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
15
16
17
18
19
20
21
|
# File 'lib/inspec/fetcher.rb', line 15
def fetcher_specified?(target)
return true if !target.respond_to?(:keys)
!(target.keys - NON_FETCHER_KEYS).empty?
end
|
#resolve(target) ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'lib/inspec/fetcher.rb', line 5
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
23
24
25
|
# File 'lib/inspec/fetcher.rb', line 23
def with_default_fetcher(target)
target.merge({ supermarket: target[:name] })
end
|