Class: RubyGemsRequirementsSystem::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems-requirements-system/installer.rb

Instance Method Summary collapse

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

#installObject



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