class Bundler::SystemRubyVersion
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.
Public Class Methods
new(*)
click to toggle source
# File lib/bundler/ruby_version.rb, line 74 def initialize(*) # override the default initialize, because # we will implement version, engine and # engine_version dynamically end
Public Instance Methods
engine()
click to toggle source
# File lib/bundler/ruby_version.rb, line 88 def engine if defined?(RUBY_ENGINE) RUBY_ENGINE.dup else # not defined in ruby 1.8.7 "ruby" end end
engine_version()
click to toggle source
# File lib/bundler/ruby_version.rb, line 97 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" end end
gem_version()
click to toggle source
# File lib/bundler/ruby_version.rb, line 84 def gem_version @gem_version ||= Gem::Version.new(version) end
patchlevel()
click to toggle source
# File lib/bundler/ruby_version.rb, line 110 def patchlevel RUBY_PATCHLEVEL.to_s end
version()
click to toggle source
# File lib/bundler/ruby_version.rb, line 80 def version RUBY_VERSION.dup end