Module: RSpec::Support::Ruby Private

Defined in:
lib/rspec/support/ruby_features.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Provides query methods for different rubies

Class Method Summary collapse

Class Method Details

.jruby?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


29
30
31
# File 'lib/rspec/support/ruby_features.rb', line 29

def jruby?
  RUBY_PLATFORM == 'java'
end

.jruby_9000?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


37
38
39
# File 'lib/rspec/support/ruby_features.rb', line 37

def jruby_9000?
  jruby? && JRUBY_VERSION >= '9.0.0.0'
end

.jruby_versionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/rspec/support/ruby_features.rb', line 33

def jruby_version
  @jruby_version ||= ComparableVersion.new(JRUBY_VERSION)
end

.mri?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


49
50
51
# File 'lib/rspec/support/ruby_features.rb', line 49

def mri?
  !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby'
end

.non_mri?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


45
46
47
# File 'lib/rspec/support/ruby_features.rb', line 45

def non_mri?
  !mri?
end

.rbx?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


41
42
43
# File 'lib/rspec/support/ruby_features.rb', line 41

def rbx?
  defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
end

.truffleruby?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


53
54
55
# File 'lib/rspec/support/ruby_features.rb', line 53

def truffleruby?
  defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby'
end