diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 5deb914db08..b744e63fe42 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -404,14 +404,6 @@ axes: - id: "ruby" display_name: Ruby Version values: - - id: "ruby-2.3" - display_name: ruby-2.3 - variables: - RVM_RUBY: "ruby-2.3" - - id: "ruby-2.4" - display_name: ruby-2.4 - variables: - RVM_RUBY: "ruby-2.4" - id: "ruby-2.5" display_name: ruby-2.5 variables: @@ -599,30 +591,6 @@ buildvariants: tasks: - name: "test" -- matrix_name: "ruby-2.4" - matrix_spec: - ruby: ["ruby-2.4"] - driver: ["current"] - topology: ['replica-set', 'sharded-cluster'] - mongodb-version: ['3.2', '3.4'] - display_name: "${ruby}, ${driver}, ${rails}, ${mongodb-version}, ${topology}" - run_on: - - ubuntu1604-small - tasks: - - name: "test" - -- matrix_name: "ruby-2.3" - matrix_spec: - ruby: ["ruby-2.3"] - driver: ["current"] - topology: ['replica-set', 'sharded-cluster'] - mongodb-version: ['2.6', '3.0'] - display_name: "${ruby}, ${driver}, ${rails}, ${mongodb-version}, ${topology}" - run_on: - - ubuntu1604-small - tasks: - - name: "test" - - matrix_name: "driver-upcoming" matrix_spec: driver: [master, stable] diff --git a/README.md b/README.md index b256f362180..5ec30277275 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Compatibility Mongoid supports and is tested against: -- MRI 2.3-3.0 +- MRI 2.5-3.0 - JRuby 9.2 - MongoDB server 2.6-4.4 diff --git a/docs/reference/compatibility.txt b/docs/reference/compatibility.txt index 3e65e55d4f7..c68665c1054 100644 --- a/docs/reference/compatibility.txt +++ b/docs/reference/compatibility.txt @@ -72,9 +72,6 @@ is deprecated. - Ruby 2.7 - Ruby 2.6 - Ruby 2.5 - - Ruby 2.4 - - Ruby 2.3 - - Ruby 2.2 - JRuby 9.2 * - 7.3 diff --git a/docs/release-notes/mongoid-7.4.txt b/docs/release-notes/mongoid-7.4.txt index 74d02f617ea..91ebd695826 100644 --- a/docs/release-notes/mongoid-7.4.txt +++ b/docs/release-notes/mongoid-7.4.txt @@ -18,6 +18,13 @@ please consult GitHub releases for detailed release notes and JIRA for the complete list of issues fixed in each release, including bug fixes. +Ruby Version Support +-------------------- + +As of version 7.4, Mongoid supports Ruby 2.5+. +Support for Ruby 2.4 and earlier has been dropped. + + ``===`` Operator Matches Ruby Semantics --------------------------------------- diff --git a/lib/mongoid.rb b/lib/mongoid.rb index e21cb06d522..c56f1beb582 100644 --- a/lib/mongoid.rb +++ b/lib/mongoid.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "support/ruby_version" - require "forwardable" require "time" require "set" diff --git a/lib/support/ruby_version.rb b/lib/support/ruby_version.rb deleted file mode 100644 index 95318cd90a9..00000000000 --- a/lib/support/ruby_version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# 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 diff --git a/mongoid.gemspec b/mongoid.gemspec index a686cca89a5..4efdcb167d7 100644 --- a/mongoid.gemspec +++ b/mongoid.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |s| warn "[#{s.name}] Warning: No private key present, creating unsigned gem." end - s.required_ruby_version = ">= 2.3" + s.required_ruby_version = ">= 2.5" s.required_rubygems_version = ">= 1.3.6" if RUBY_VERSION.start_with?('2.') diff --git a/spec/mongoid/association/referenced/has_many/enumerable_spec.rb b/spec/mongoid/association/referenced/has_many/enumerable_spec.rb index 874061864b0..108c4c24e7c 100644 --- a/spec/mongoid/association/referenced/has_many/enumerable_spec.rb +++ b/spec/mongoid/association/referenced/has_many/enumerable_spec.rb @@ -288,7 +288,6 @@ end context "when an argument is given" do - ruby_version_gte '2.5' it "returns true when the argument is true" do expect(enumerable.any?(Post)).to be true @@ -300,7 +299,6 @@ end context "when both an argument and a block are given" do - ruby_version_gte '2.5' it "gives precedence to the pattern" do expect( @@ -339,7 +337,6 @@ end context "when an argument is given" do - ruby_version_gte '2.5' it "returns true when the argument is true" do expect(enumerable.any?(Post)).to be true @@ -351,7 +348,6 @@ end context "when both an argument and a block are given" do - ruby_version_gte '2.5' it "gives precedence to the pattern" do expect( diff --git a/spec/mongoid/touchable_spec.rb b/spec/mongoid/touchable_spec.rb index 967d343a7da..5934da242e7 100644 --- a/spec/mongoid/touchable_spec.rb +++ b/spec/mongoid/touchable_spec.rb @@ -312,11 +312,7 @@ end let(:frozen_error_cls) do - if RUBY_VERSION >= '2.5' - FrozenError - else - RuntimeError - end + FrozenError end context "when no attribute is provided" do