Class: RubyGemsRequirementsSystem::Installer
- Inherits:
-
Object
- Object
- RubyGemsRequirementsSystem::Installer
- Defined in:
- lib/rubygems-requirements-system/installer.rb
Instance Method Summary collapse
-
#initialize(gemspec, ui) ⇒ Installer
constructor
A new instance of Installer.
- #install ⇒ Object
Constructor Details
#initialize(gemspec, ui) ⇒ Installer
Returns a new instance of Installer.
35 36 37 38 39 |
# File 'lib/rubygems-requirements-system/installer.rb', line 35 def initialize(gemspec, ui) @gemspec = gemspec @ui = UI.new(ui) @platform = Platform.detect(@ui) end |
Instance Method Details
#install ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rubygems-requirements-system/installer.rb', line 41 def install return true unless enabled? parser = RequirementsParser.new(@gemspec.requirements, @platform, @ui) requirements = parser.parse requirements.all? do |requirement| next true if requirement.satisfied? @platform.install(requirement) end end |