Module: BSON::Environment
Overview
Provides static helper methods around determining what environment is running without polluting the global namespace.
Instance Method Summary collapse
-
#jruby? ⇒ true, false
Determine if we are using JRuby or not.
-
#retaining_hash_order? ⇒ true, false
Does the Ruby runtime we are using support ordered hashes?.
-
#ruby_18? ⇒ true, false
Are we running in a ruby runtime that is version 1.8.x?.
Instance Method Details
#jruby? ⇒ true, false
Determine if we are using JRuby or not.
32 33 34 |
# File 'lib/bson/environment.rb', line 32 def jruby? defined?(JRUBY_VERSION) end |
#retaining_hash_order? ⇒ true, false
Does the Ruby runtime we are using support ordered hashes?
44 45 46 |
# File 'lib/bson/environment.rb', line 44 def retaining_hash_order? jruby? || RUBY_VERSION > "1.9.1" end |
#ruby_18? ⇒ true, false
Are we running in a ruby runtime that is version 1.8.x?
56 57 58 |
# File 'lib/bson/environment.rb', line 56 def ruby_18? RUBY_VERSION < "1.9" end |