Sha256: 057a8e0a0b47755f8334aed00da30fc46fe6e5c35b0e0ca75668f28d17e8ee0e

Contents?: true

Size: 756 Bytes

Versions: 73

Compression:

Stored size: 756 Bytes

Contents

# Go ahead and fail if not using Ruby 1.9.3, no since in letting people
# squarm for answers
def raise_version_error(message)
  puts message
  Rails.logger.info(message) if defined?(Rails) && Rails.logger
  raise
end

def invalid_version?
  RUBY_VERSION =~ /([\d]+)\.([\d]+)\.([\d]+)/
  major, minor, revision = $1.to_i, $2.to_i, $3.to_i
  if defined?(JRUBY_VERSION)
    major <= 1 && minor <= 9 && revision <= 1
  else
    major <= 1 && minor <= 9 && revision <= 2
  end
end

if invalid_version?
  message = %{
Mongoid requires MRI version 1.9.3+ or JRuby 1.6.0+ running in 1.9 mode.
Your current Ruby version is defined as #{RUBY_VERSION}. Please see:
http://mongoid.org/en/mongoid/docs/tips.html#ruby for details.
  }
  raise_version_error(message)
end

Version data entries

73 entries across 68 versions & 6 rubygems

Version Path
mongoid-7.0.13 lib/support/ruby_version.rb
mongoid-7.0.12 lib/support/ruby_version.rb
mongoid-6.4.8 lib/support/ruby_version.rb
mongoid-7.0.11 lib/support/ruby_version.rb
mongoid-7.0.10 lib/support/ruby_version.rb
mongoid-6.4.7 lib/support/ruby_version.rb
mongoid-6.4.5 lib/support/ruby_version.rb
mongoid-7.0.8 lib/support/ruby_version.rb
mongoid-7.0.7 lib/support/ruby_version.rb
mongoid-7.0.6 lib/support/ruby_version.rb
mongoid-5.4.1 lib/support/ruby_version.rb
mongoid-7.0.5 lib/support/ruby_version.rb
mongoid-7.0.4 lib/support/ruby_version.rb
mongoid-6.4.4 lib/support/ruby_version.rb
mongoid-7.0.3 lib/support/ruby_version.rb
mongoid-6.4.2 lib/support/ruby_version.rb
mongoid-7.0.2 lib/support/ruby_version.rb
mongoid-7.0.1 lib/support/ruby_version.rb
mongoid-6.4.1 lib/support/ruby_version.rb
mongoid-5.4.0 lib/support/ruby_version.rb