Class: Supermarket::SupermarketHelper
- Inherits:
-
Inspec::Targets::UrlHelper
- Object
- Inspec::Targets::UrlHelper
- Supermarket::SupermarketHelper
- Defined in:
- lib/bundles/inspec-supermarket/target.rb
Instance Method Summary collapse
- #handles?(profile) ⇒ Boolean
-
#resolve(profile, opts = {}) ⇒ Object
generates proper url.
- #to_s ⇒ Object
Methods inherited from Inspec::Targets::UrlHelper
#download_archive, #resolve_archive
Instance Method Details
#handles?(profile) ⇒ Boolean
10 11 12 13 14 15 16 17 18 |
# File 'lib/bundles/inspec-supermarket/target.rb', line 10 def handles?(profile) # check for local scheme supermarket:// return unless URI(profile).scheme == 'supermarket' # verifies that the target e.g base/ssh exists Supermarket::API.exist?(profile) rescue URI::Error => _e false end |
#resolve(profile, opts = {}) ⇒ Object
generates proper url
21 22 23 24 |
# File 'lib/bundles/inspec-supermarket/target.rb', line 21 def resolve(profile, opts = {}) tool_info = Supermarket::API.find(profile) super(tool_info['tool_source_url'], opts) end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/bundles/inspec-supermarket/target.rb', line 26 def to_s 'Chef Compliance Profile Loader' end |