Class: RubyDep::Travis::RubyVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_dep/travis/ruby_version.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

REGEXP =
/^
(?:
 (?<engine>ruby|jruby)
-)?
  (?<version>\d+\.\d+\.\d+(?:\.\d+)?)
(?:-p\d+)?
(?:-clang)?
$/x

Instance Method Summary collapse

Constructor Details

#initialize(travis_version_string) ⇒ RubyVersion

Returns a new instance of RubyVersion.


31
32
33
34
# File 'lib/ruby_dep/travis/ruby_version.rb', line 31

def initialize(travis_version_string)
  ruby_version_string = version_for(travis_version_string)
  @version = Gem::Version.new(ruby_version_string)
end

Instance Method Details

#segmentsObject


36
37
38
# File 'lib/ruby_dep/travis/ruby_version.rb', line 36

def segments
  @version.segments
end