Sha256: 43af15dedfd68f04a788c9c2f79eb04725700d0e42f4924f72583a2b91fd63ce

Contents?: true

Size: 805 Bytes

Versions: 27

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

# 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

27 entries across 27 versions & 2 rubygems

Version Path
mongoid-7.3.5 lib/support/ruby_version.rb
mongoid-7.3.4 lib/support/ruby_version.rb
mongoid-7.1.11 lib/support/ruby_version.rb
mongoid-7.2.6 lib/support/ruby_version.rb
mongoid-7.3.3 lib/support/ruby_version.rb
mongoid-7.3.2 lib/support/ruby_version.rb
mongoid-7.2.5 lib/support/ruby_version.rb
mongoid-7.1.10 lib/support/ruby_version.rb
mongoid-7.1.9 lib/support/ruby_version.rb
mongoid-7.2.4 lib/support/ruby_version.rb
mongoid-7.3.1 lib/support/ruby_version.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/lib/support/ruby_version.rb
mongoid-7.3.0 lib/support/ruby_version.rb
mongoid-7.2.3 lib/support/ruby_version.rb
mongoid-7.1.8 lib/support/ruby_version.rb
mongoid-7.2.2 lib/support/ruby_version.rb
mongoid-7.2.1 lib/support/ruby_version.rb
mongoid-7.1.7 lib/support/ruby_version.rb
mongoid-7.2.0 lib/support/ruby_version.rb
mongoid-7.1.6 lib/support/ruby_version.rb