module Concurrent::Utility::EngineDetector
@!visibility private
Public Instance Methods
on_cruby?()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 14 def on_cruby? ruby_engine == 'ruby' end
on_jruby?()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 6 def on_jruby? ruby_engine == 'jruby' end
on_jruby_9000?()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 10 def on_jruby_9000? on_jruby? && 0 == (JRUBY_VERSION =~ /^9\.0\.0\.0/) end
on_rbx?()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 18 def on_rbx? ruby_engine == 'rbx' end
on_truffle?()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 22 def on_truffle? ruby_engine == 'jruby+truffle' end
on_windows?()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 26 def on_windows? !(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/).nil? end
ruby_engine()
click to toggle source
# File lib/concurrent/utility/engine.rb, line 30 def ruby_engine defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' end
ruby_version(comparison, major, minor = 0, patch = 0)
click to toggle source
# File lib/concurrent/utility/engine.rb, line 34 def ruby_version(comparison, major, minor = 0, patch = 0) result = (RUBY_VERSION.split('.').map(&:to_i) <=> [major, minor, patch]) comparisons = { :== => [0], :>= => [1, 0], :<= => [-1, 0], :> => [1], :< => [-1] } comparisons.fetch(comparison).include? result end