Class: Inspec::DependencyInstaller
- Inherits:
-
Object
- Object
- Inspec::DependencyInstaller
- Extended by:
- Forwardable
- Defined in:
- lib/inspec/dependency_installer.rb
Instance Attribute Summary collapse
-
#dependency_loader ⇒ Object
readonly
Returns the value of attribute dependency_loader.
-
#gem_path ⇒ Object
readonly
Returns the value of attribute gem_path.
-
#requested_gems ⇒ Object
readonly
Returns the value of attribute requested_gems.
Instance Method Summary collapse
-
#initialize(gem_path = nil, requested_gems = []) ⇒ DependencyInstaller
constructor
A new instance of DependencyInstaller.
- #install ⇒ Object
Constructor Details
#initialize(gem_path = nil, requested_gems = []) ⇒ DependencyInstaller
Returns a new instance of DependencyInstaller.
15 16 17 18 19 |
# File 'lib/inspec/dependency_installer.rb', line 15 def initialize(gem_path = nil, requested_gems = []) @dependency_loader = Inspec::DependencyLoader.new @gem_path = gem_path || inspec_gem_path @requested_gems = requested_gems end |
Instance Attribute Details
#dependency_loader ⇒ Object (readonly)
Returns the value of attribute dependency_loader.
11 12 13 |
# File 'lib/inspec/dependency_installer.rb', line 11 def dependency_loader @dependency_loader end |
#gem_path ⇒ Object (readonly)
Returns the value of attribute gem_path.
11 12 13 |
# File 'lib/inspec/dependency_installer.rb', line 11 def gem_path @gem_path end |
#requested_gems ⇒ Object (readonly)
Returns the value of attribute requested_gems.
11 12 13 |
# File 'lib/inspec/dependency_installer.rb', line 11 def requested_gems @requested_gems end |
Instance Method Details
#install ⇒ Object
21 22 23 24 25 26 |
# File 'lib/inspec/dependency_installer.rb', line 21 def install requested_gems.each do |requested_gem| version = requested_gem[:version].nil? ? "> 0" : requested_gem[:version] install_from_remote_gems(requested_gem[:name], { version: version }) end end |