Class: Bundler::SystemRubyVersion
- Inherits:
-
RubyVersion
- Object
- RubyVersion
- Bundler::SystemRubyVersion
- Defined in:
- lib/bundler/ruby_version.rb
Overview
A subclass of RubyVersion that implements version, engine and engine_version based upon the current information in the system. It can be used anywhere a RubyVersion object is expected, and can be compared with a RubyVersion object.
Instance Method Summary collapse
- #engine ⇒ Object
- #engine_version ⇒ Object
- #gem_version ⇒ Object
-
#initialize ⇒ SystemRubyVersion
constructor
A new instance of SystemRubyVersion.
- #patchlevel ⇒ Object
- #version ⇒ Object
Methods inherited from RubyVersion
Constructor Details
#initialize ⇒ SystemRubyVersion
Returns a new instance of SystemRubyVersion.
76 77 78 79 80 |
# File 'lib/bundler/ruby_version.rb', line 76 def initialize(*) # override the default initialize, because # we will implement version, engine and # engine_version dynamically end |
Instance Method Details
#engine ⇒ Object
90 91 92 93 94 95 96 97 |
# File 'lib/bundler/ruby_version.rb', line 90 def engine if defined?(RUBY_ENGINE) RUBY_ENGINE.dup else # not defined in ruby 1.8.7 "ruby" end end |
#engine_version ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/bundler/ruby_version.rb', line 99 def engine_version case engine when "ruby" RUBY_VERSION.dup when "rbx" Rubinius::VERSION.dup when "jruby" JRUBY_VERSION.dup else raise BundlerError, "RUBY_ENGINE value #{RUBY_ENGINE} is not recognized" nil end end |
#gem_version ⇒ Object
86 87 88 |
# File 'lib/bundler/ruby_version.rb', line 86 def gem_version @gem_version ||= Gem::Version.new(version) end |
#patchlevel ⇒ Object
113 114 115 |
# File 'lib/bundler/ruby_version.rb', line 113 def patchlevel RUBY_PATCHLEVEL.to_s end |
#version ⇒ Object
82 83 84 |
# File 'lib/bundler/ruby_version.rb', line 82 def version RUBY_VERSION.dup end |