class method
Gem.ruby_version
() -> ::Gem::Version
ruby_version
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems.rb, line 948
def self.ruby_version
return @ruby_version if defined? @ruby_version
version = RUBY_VERSION.dup
if RUBY_PATCHLEVEL == -1
if RUBY_ENGINE == "ruby"
desc = RUBY_DESCRIPTION[/\Aruby #{Regexp.quote(RUBY_VERSION)}([^ ]+) /, 1]
else
desc = RUBY_DESCRIPTION[/\A#{RUBY_ENGINE} #{Regexp.quote(RUBY_ENGINE_VERSION)} \(#{RUBY_VERSION}([^ ]+)\) /, 1]
end
version << ".#{desc}" if desc
end
@ruby_version = Gem::Version.new version
end
A Gem::Version for the currently running Ruby.
See also
.rubygems_version
.set_target_rbconfig
.ruby_engine
.solaris_platform?
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0