Sha256: 37d0572c8a4e5543c5772b337206a482c181130a245a3fd9d262d28f8da61f88

Contents?: true

Size: 1.06 KB

Versions: 103

Compression:

Stored size: 1.06 KB

Contents

module Concurrent
  # @!visibility private
  module Utility

    # @!visibility private
    module EngineDetector
      def on_cruby?
        RUBY_ENGINE == 'ruby'
      end

      def on_jruby?
        RUBY_ENGINE == 'jruby'
      end

      def on_truffleruby?
        RUBY_ENGINE == 'truffleruby'
      end

      def on_windows?
        !(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/).nil?
      end

      def on_osx?
        !(RbConfig::CONFIG['host_os'] =~ /darwin|mac os/).nil?
      end

      def on_linux?
        !(RbConfig::CONFIG['host_os'] =~ /linux/).nil?
      end

      def ruby_version(version = RUBY_VERSION, comparison, major, minor, patch)
        result      = (version.split('.').map(&:to_i) <=> [major, minor, patch])
        comparisons = { :== => [0],
                        :>= => [1, 0],
                        :<= => [-1, 0],
                        :>  => [1],
                        :<  => [-1] }
        comparisons.fetch(comparison).include? result
      end
    end
  end

  # @!visibility private
  extend Utility::EngineDetector
end

Version data entries

103 entries across 103 versions & 16 rubygems

Version Path
harbr-0.1.87 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.86 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.85 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.84 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.83 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.82 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.81 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.80 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.79 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.78 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.77 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.76 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.75 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.74 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.73 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.72 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.71 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.70 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.69 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb
harbr-0.1.68 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/utility/engine.rb