Class: ConvenientService::Dependencies::Queries::Ruby Private

Inherits:
Object
  • Object
show all
Defined in:
lib/convenient_service/dependencies/queries/ruby.rb

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

Class Method Summary collapse

Class Method Details

.engineString Also known as: engine_name

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:

  • (String)


33
34
35
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 33

def engine
  ::RUBY_ENGINE.to_s
end

.engine_versionConvenientService::Dependencies::Queries::Version

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.



57
58
59
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 57

def engine_version
  @engine_version ||= Version.new(::RUBY_ENGINE_VERSION)
end

.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 ‘true` when JRuby, `false` otherwise.

Returns:

  • (Boolean)

See Also:



88
89
90
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 88

def jruby?
  engine.include?("jruby")
end

.match?(pattern) ⇒ 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 ‘true` when TruffleRuby, `false` otherwise.

Parameters:

  • pattern (String)

Returns:

  • (Boolean)


107
108
109
110
111
112
113
114
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 107

def match?(pattern)
  engine_name, operator, engine_version = pattern.split(" ")

  return false unless public_send("#{engine_name}?")
  return false unless self.engine_version.public_send(operator, engine_version)

  true
end

.mri?Boolean Also known as: ruby?

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 ‘true` when MRI, `false` otherwise.

Returns:

  • (Boolean)

See Also:



72
73
74
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 72

def mri?
  engine == "ruby"
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 ‘true` when TruffleRuby, `false` otherwise.

Returns:

  • (Boolean)


97
98
99
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 97

def truffleruby?
  engine.include?("truffleruby")
end

.versionConvenientService::Dependencies::Queries::Version

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.



23
24
25
# File 'lib/convenient_service/dependencies/queries/ruby.rb', line 23

def version
  @version ||= Version.new(::RUBY_VERSION)
end