Sha256: 36dbd18db35622132261b3ff33105bb93840027f8b7f9aae425a854b696c1580

Contents?: true

Size: 1.01 KB

Versions: 25

Compression:

Stored size: 1.01 KB

Contents

module Concurrent
  module Utility

    # @!visibility private
    module EngineDetector
      def on_jruby?
        ruby_engine == 'jruby'
      end

      def on_jruby_9000?
        on_jruby? && 0 == (JRUBY_VERSION =~ /^9\.0\.0\.0/)
      end

      def on_cruby?
        ruby_engine == 'ruby'
      end

      def on_rbx?
        ruby_engine == 'rbx'
      end

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

      def ruby_engine
        defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
      end

      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
    end
  end

  # @!visibility private
  extend Utility::EngineDetector
end

Version data entries

25 entries across 23 versions & 5 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/utility/engine.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/utility/engine.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/utility/engine.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/utility/engine.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/utility/engine.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/utility/engine.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/concurrent-ruby-0.9.1-java/lib/concurrent/utility/engine.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/utility/engine.rb
logstash-codec-json-2.0.3 vendor/gems/concurrent-ruby-0.9.1-java/lib/concurrent/utility/engine.rb
concurrent-ruby-0.9.2-java lib/concurrent/utility/engine.rb
concurrent-ruby-0.9.2 lib/concurrent/utility/engine.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/utility/engine.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre4-java lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre4 lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre3-java lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre3 lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre2-java lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre2 lib/concurrent/utility/engine.rb
concurrent-ruby-1.0.0.pre1 lib/concurrent/utility/engine.rb