Class: Gem::Requirement

Inherits:
Object show all
Defined in:
lib/ruby/gem/requirement.rb

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ruby/gem/requirement.rb', line 11

def eql?(other)
  self == other
end

#satisfies?(version) ⇒ Boolean Also known as: satisfies

TODO: refactor Doubleshot to only use satisfied_by?(Gem::Version) instead of satisfies?(String|Gem::Version)

Returns:

  • (Boolean)


3
4
5
6
7
8
# File 'lib/ruby/gem/requirement.rb', line 3

def satisfies?(version)
  unless version.is_a? Gem::Version
    version = Gem::Version.new(version.to_s)
  end
  satisfied_by? version
end