Parent

Methods

GemInstaller::RubyGemsVersionChecker

Public Class Methods

matches?(version_spec, options = {}) click to toggle source
    # File lib/geminstaller/rubygems_version_checker.rb, line 3
 3:     def self.matches?(version_spec, options = {})
 4:       version_spec = [version_spec] unless version_spec.kind_of?(Array)
 5:       # TODO: if rubygems has already been initialized before GemInstaller overrides the rubygems version,
 6:       # (for example, by running rspec), then Gem::RubyGemsVersion could be initialized to the incorrect
 7:       # system-rubygems version instead of the geminstaller-overridden version.  Need to figure out how
 8:       # to re-parse 'rubygems/rubygems_version' and let it redefine 'Gem::RubyGemsVersion'
 9:       rubygems_version = options[:rubygems_version] ||= Gem::RubyGemsVersion
10:       
11:       # Manually check here in addition to backward_compatibility.rb, to avoid circular dependency
12:       if defined?(Gem::Requirement)
13:         requirement_class = Gem::Requirement
14:       else
15:         requirement_class = Gem::Version::Requirement
16:       end
17:       
18:       requirement_class.new(version_spec).satisfied_by?(Gem::Version.new(rubygems_version))
19:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.