Class: Inspec::FetcherRegistry
Constant Summary
collapse
- NON_FETCHER_KEYS =
%i{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
22
|
# File 'lib/inspec/fetcher.rb', line 15
def fetcher_specified?(target)
return true unless target.respond_to?(:keys)
!(target.keys - NON_FETCHER_KEYS).empty?
end
|
#resolve(target, opts = {}) ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'lib/inspec/fetcher.rb', line 5
def resolve(target, opts = {})
if fetcher_specified?(target)
super(target, opts)
else
Inspec::Log.debug("Assuming default supermarket source for #{target}")
super(with_default_fetcher(target), opts)
end
end
|
#with_default_fetcher(target) ⇒ Object
24
25
26
|
# File 'lib/inspec/fetcher.rb', line 24
def with_default_fetcher(target)
target.merge({ supermarket: target[:name] })
end
|