Class: Supermarket::Fetcher

Inherits:
Fetchers::Url show all
Defined in:
lib/bundles/inspec-supermarket/target.rb

Constant Summary

Constants inherited from Fetchers::Url

Fetchers::Url::MIME_TYPES

Instance Attribute Summary

Attributes inherited from Fetchers::Url

#archive, #files

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fetchers::Url

download_archive, #initialize, transform

Constructor Details

This class inherits a constructor from Fetchers::Url

Class Method Details

.resolve(target, opts = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/bundles/inspec-supermarket/target.rb', line 15

def self.resolve(target, opts = {})
  return nil unless URI(target).scheme == 'supermarket'
  return nil unless Supermarket::API.exist?(target)
  tool_info = Supermarket::API.find(target)
  super(tool_info['tool_source_url'], opts)
rescue URI::Error => _e
  nil
end

Instance Method Details

#to_sObject



24
25
26
# File 'lib/bundles/inspec-supermarket/target.rb', line 24

def to_s
  'Chef Compliance Profile Loader'
end