Skip to content

Commit

Permalink
MONGOID-5171 - Make the minimum Ruby version 2.5 (#5058)
Browse files Browse the repository at this point in the history
* MONGOID-5171 - Make the minimum Ruby version 2.5. Also get rid of the "ruby_version" module, which seems unused/out-of-date.

* revert doc change

* add 7.4 to compat tables removing Ruby 2.3/2.4 from it

Co-authored-by: shields <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>
  • Loading branch information
3 people authored Aug 27, 2021
1 parent e2b7765 commit 84312b6
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 73 deletions.
32 changes: 0 additions & 32 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 32 additions & 0 deletions docs/reference/compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ specified Mongoid versions.
- Driver 2.15-2.10
- Driver 2.9-2.7

* - 7.4
- |checkmark|
-

* - 7.3
- |checkmark|
-
Expand Down Expand Up @@ -77,6 +81,16 @@ is deprecated.
- Ruby 2.2
- JRuby 9.2

* - 7.4
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
-
-
-
- |checkmark|

* - 7.3
- |checkmark| [#mongoid-7.3-ruby-3.0]_
- |checkmark|
Expand Down Expand Up @@ -165,6 +179,16 @@ for driver compatibility matrices.
- MongoDB 3.0
- MongoDB 2.6

* - 7.4
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|
- |checkmark|

* - 7.3
- |checkmark|
- |checkmark|
Expand Down Expand Up @@ -237,6 +261,14 @@ are supported by Mongoid.
- Rails 5.0
- Rails 4.2

* - 7.4
- |checkmark|
- |checkmark|
- |checkmark| [#rails-5-ruby-3.0]_
- |checkmark| [#rails-5-ruby-3.0]_
-
-

* - 7.3
- |checkmark|
- |checkmark|
Expand Down
7 changes: 7 additions & 0 deletions docs/release-notes/mongoid-7.4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions lib/mongoid.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "support/ruby_version"

require "forwardable"
require "time"
require "set"
Expand Down
28 changes: 0 additions & 28 deletions lib/support/ruby_version.rb

This file was deleted.

2 changes: 1 addition & 1 deletion mongoid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions spec/mongoid/touchable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,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
Expand Down

0 comments on commit 84312b6

Please sign in to comment.