Class: Inspec::Dependencies
- Inherits:
-
Object
- Object
- Inspec::Dependencies
- Defined in:
- lib/inspec/dependencies.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#vendor_path ⇒ Object
readonly
Returns the value of attribute vendor_path.
Instance Method Summary collapse
-
#initialize(cwd, vendor_path) ⇒ dependencies
constructor
initialize.
-
#vendor(dependencies) ⇒ nil
1.
Constructor Details
#initialize(cwd, vendor_path) ⇒ dependencies
initialize
290 291 292 293 294 |
# File 'lib/inspec/dependencies.rb', line 290 def initialize(cwd, vendor_path) @cwd = cwd @vendor_path = vendor_path || File.join(Dir.home, '.inspec', 'cache') @list = nil end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
283 284 285 |
# File 'lib/inspec/dependencies.rb', line 283 def list @list end |
#vendor_path ⇒ Object (readonly)
Returns the value of attribute vendor_path.
283 284 285 |
# File 'lib/inspec/dependencies.rb', line 283 def vendor_path @vendor_path end |
Instance Method Details
#vendor(dependencies) ⇒ nil
-
Get dependencies, pull things to a local cache if necessary
-
Resolve dependencies
301 302 303 304 305 |
# File 'lib/inspec/dependencies.rb', line 301 def vendor(dependencies) return if dependencies.nil? || dependencies.empty? @vendor_index ||= VendorIndex.new(@vendor_path) @list = Resolver.resolve(dependencies, @vendor_index, @cwd) end |