Class: Bundler::CurrentRuby
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/bundler/current_ruby.rb |
Constant Summary
-
ALL_RUBY_VERSIONS =
# File 'lib/bundler/current_ruby.rb', line 14(18..27).to_a.concat((30..35).to_a).freeze
-
KNOWN_MAJOR_VERSIONS =
# File 'lib/bundler/current_ruby.rb', line 16ALL_RUBY_VERSIONS.map {|v| v.digits.last.to_s }.uniq.freeze
-
KNOWN_MINOR_VERSIONS =
# File 'lib/bundler/current_ruby.rb', line 15ALL_RUBY_VERSIONS.map {|v| v.digits.reverse.join(".") }.freeze
-
PLATFORM_MAP =
# File 'lib/bundler/current_ruby.rb', line 17{ ruby: [Gem::Platform::RUBY, CurrentRuby::ALL_RUBY_VERSIONS], mri: [Gem::Platform::RUBY, CurrentRuby::ALL_RUBY_VERSIONS], rbx: [Gem::Platform::RUBY], truffleruby: [Gem::Platform::RUBY], jruby: [Gem::Platform::JAVA, [18, 19]], windows: [Gem::Platform::WINDOWS, CurrentRuby::ALL_RUBY_VERSIONS], # deprecated mswin: [Gem::Platform::MSWIN, CurrentRuby::ALL_RUBY_VERSIONS], mswin64: [Gem::Platform::MSWIN64, CurrentRuby::ALL_RUBY_VERSIONS - [18]], mingw: [Gem::Platform::UNIVERSAL_MINGW, CurrentRuby::ALL_RUBY_VERSIONS], x64_mingw: [Gem::Platform::UNIVERSAL_MINGW, CurrentRuby::ALL_RUBY_VERSIONS - [18, 19]], }.each_with_object({}) do |(platform, spec), hash| hash[platform] = spec[0] spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] } end.freeze
Instance Attribute Summary
- #jruby? ⇒ Boolean readonly
- #maglev? ⇒ Boolean readonly
-
#mingw?
readonly
Alias for #windows?.
- #mri? ⇒ Boolean readonly
-
#mswin64?
readonly
Alias for #windows?.
-
#mswin?
readonly
Alias for #windows?.
- #rbx? ⇒ Boolean readonly
- #ruby? ⇒ Boolean readonly
- #truffleruby? ⇒ Boolean readonly
- #windows? ⇒ Boolean (also: #mswin?, #mswin64?, #mingw?, #x64_mingw?) readonly
-
#x64_mingw?
readonly
Alias for #windows?.
Instance Attribute Details
#jruby? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 48
def jruby? RUBY_ENGINE == "jruby" end
#maglev? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 52
def maglev? = "`CurrentRuby#maglev?` is deprecated with no replacement. Please use the " \ "built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on." = "`CurrentRuby#maglev?` was removed with no replacement. Please use the " \ "built-in Ruby `RUBY_ENGINE` constant to check the Ruby implementation you are running on." internally_exempted = caller_locations(1, 1).first.path == __FILE__ unless internally_exempted SharedHelpers.major_deprecation(2, , removed_message: , print_caller_location: true) end RUBY_ENGINE == "maglev" end
#mingw? (readonly)
Alias for #windows?.
# File 'lib/bundler/current_ruby.rb', line 77
alias_method :mingw?, :windows?
#mri? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 40
def mri? !windows? && RUBY_ENGINE == "ruby" end
#mswin64? (readonly)
Alias for #windows?.
# File 'lib/bundler/current_ruby.rb', line 76
alias_method :mswin64?, :windows?
#mswin? (readonly)
Alias for #windows?.
# File 'lib/bundler/current_ruby.rb', line 75
alias_method :mswin?, :windows?
#rbx? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 44
def rbx? ruby? && RUBY_ENGINE == "rbx" end
#ruby? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 34
def ruby? return true if Bundler::GemHelpers.generic_local_platform_is_ruby? !windows? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby") end
#truffleruby? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 68
def truffleruby? RUBY_ENGINE == "truffleruby" end
#windows? ⇒ Boolean
(readonly)
Also known as: #mswin?, #mswin64?, #mingw?, #x64_mingw?
[ GitHub ]
# File 'lib/bundler/current_ruby.rb', line 72
def windows? Gem.win_platform? end
#x64_mingw? (readonly)
Alias for #windows?.
# File 'lib/bundler/current_ruby.rb', line 78
alias_method :x64_mingw?, :windows?