Class: Bundler::CurrentRuby

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/current_ruby.rb

Constant Summary collapse

KNOWN_MINOR_VERSIONS =
%w[
  1.8
  1.9
  2.0
  2.1
  2.2
  2.3
  2.4
  2.5
  2.6
  2.7
].freeze
KNOWN_MAJOR_VERSIONS =
KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
KNOWN_PLATFORMS =
%w[
  jruby
  maglev
  mingw
  mri
  mswin
  mswin64
  rbx
  ruby
  truffleruby
  x64_mingw
].freeze

Instance Method Summary collapse

Instance Method Details

#jruby?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/bundler/current_ruby.rb', line 54

def jruby?
  RUBY_ENGINE == "jruby"
end

#maglev?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/bundler/current_ruby.rb', line 58

def maglev?
  RUBY_ENGINE == "maglev"
end

#mingw?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/bundler/current_ruby.rb', line 74

def mingw?
  Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
end

#mri?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/bundler/current_ruby.rb', line 46

def mri?
  !mswin? && RUBY_ENGINE == "ruby"
end

#mswin64?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/bundler/current_ruby.rb', line 70

def mswin64?
  Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
end

#mswin?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/bundler/current_ruby.rb', line 66

def mswin?
  Bundler::WINDOWS
end

#rbx?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/bundler/current_ruby.rb', line 50

def rbx?
  ruby? && RUBY_ENGINE == "rbx"
end

#ruby?Boolean

Returns:

  • (Boolean)


40
41
42
43
44
# File 'lib/bundler/current_ruby.rb', line 40

def ruby?
  return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY

  !mswin? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
end

#truffleruby?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/bundler/current_ruby.rb', line 62

def truffleruby?
  RUBY_ENGINE == "truffleruby"
end

#x64_mingw?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/bundler/current_ruby.rb', line 78

def x64_mingw?
  Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
end