Skip to content

Commit 655fad6

Browse files
authored
Merge pull request #828 from Dynamoid/ak/update-ruby-and-rails-on-ci
Update Ruby and RubyOnRails versions on CI
2 parents 312421b + ab0e129 commit 655fad6

File tree

12 files changed

+139
-9
lines changed

12 files changed

+139
-9
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
- rails_6_1
4040
- rails_7_0
4141
- rails_7_1
42+
- rails_7_2
43+
- rails_8_0
4244
rubygems:
4345
- default
4446
bundler:
@@ -54,8 +56,39 @@ jobs:
5456
- "3.1"
5557
- "3.2"
5658
- "3.3"
59+
- "3.4"
5760
exclude:
5861

62+
# Rails 8.0 requires Ruby 3.2 and above
63+
- gemfile: rails_8_0
64+
ruby: "2.3"
65+
- gemfile: rails_8_0
66+
ruby: "2.4"
67+
- gemfile: rails_8_0
68+
ruby: "2.5"
69+
- gemfile: rails_8_0
70+
ruby: "2.6"
71+
- gemfile: rails_8_0
72+
ruby: "2.7"
73+
- gemfile: rails_8_0
74+
ruby: "3.0"
75+
- gemfile: rails_8_0
76+
ruby: "3.1"
77+
78+
# Rails 7.2 requires Ruby 3.1 and above
79+
- gemfile: rails_7_2
80+
ruby: "2.3"
81+
- gemfile: rails_7_2
82+
ruby: "2.4"
83+
- gemfile: rails_7_2
84+
ruby: "2.5"
85+
- gemfile: rails_7_2
86+
ruby: "2.6"
87+
- gemfile: rails_7_2
88+
ruby: "2.7"
89+
- gemfile: rails_7_2
90+
ruby: "3.0"
91+
5992
# Rails 7.1 requires Ruby 2.7 and above
6093
- gemfile: rails_7_1
6194
ruby: "2.3"
@@ -121,6 +154,14 @@ jobs:
121154
gemfile: rails_5_1
122155
- ruby: "3.3"
123156
gemfile: rails_5_2
157+
- ruby: "3.4"
158+
gemfile: rails_4_2
159+
- ruby: "3.4"
160+
gemfile: rails_5_0
161+
- ruby: "3.4"
162+
gemfile: rails_5_1
163+
- ruby: "3.4"
164+
gemfile: rails_5_2
124165

125166
- ruby: "jruby"
126167
gemfile: rails_4_2
@@ -130,6 +171,8 @@ jobs:
130171
gemfile: rails_5_1
131172
- ruby: "jruby"
132173
gemfile: rails_5_2
174+
- ruby: "jruby" # Rails 8.0 requires Ruby >= 3.2 but current JRuby (9.4.9.0) compatible with Ruby 3.1
175+
gemfile: rails_8_0
133176

134177
include:
135178
- ruby: "jruby-9.3.9.0"

Appraisals

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,54 @@ end
2727

2828
appraise 'rails-6-0' do
2929
gem 'activemodel', '~> 6.0.0'
30+
31+
# Since Ruby 3.4 these dependencies are bundled gems so should be specified explicitly.
32+
gem 'mutex_m'
33+
gem 'base64'
34+
gem 'bigdecimal'
3035
end
3136

3237
appraise 'rails-6-1' do
3338
gem 'activemodel', '~> 6.1.0'
39+
40+
# Since Ruby 3.4 these dependencies are bundled gems so should be specified explicitly.
41+
gem 'mutex_m'
42+
gem 'base64'
43+
gem 'bigdecimal'
3444
end
3545

3646
appraise 'rails-7-0' do
3747
gem 'activemodel', '~> 7.0.0'
48+
49+
# Since Ruby 3.4 these dependencies are bundled gems so should be specified explicitly.
50+
gem 'mutex_m'
51+
gem 'base64'
52+
gem 'bigdecimal'
3853
end
3954

4055
appraise 'rails-7-1' do
4156
gem 'activemodel', '~> 7.1.0'
57+
58+
# Since Ruby 3.4 these dependencies are bundled gems so should be specified explicitly.
59+
gem 'mutex_m'
60+
gem 'base64'
61+
gem 'bigdecimal'
62+
end
63+
64+
appraise 'rails-7-2' do
65+
gem 'activemodel', '~> 7.2.0'
66+
67+
# Since Ruby 3.4 these dependencies are bundled gems so should be specified explicitly.
68+
gem 'mutex_m'
69+
gem 'base64'
70+
gem 'bigdecimal'
71+
end
72+
73+
appraise 'rails-8-0' do
74+
gem 'activemodel', '~> 8.0.0'
75+
76+
# Since Ruby 3.4 these dependencies are bundled gems so should be specified explicitly.
77+
gem 'mutex_m'
78+
gem 'base64'
79+
gem 'bigdecimal'
4280
end

gemfiles/rails_6_0.gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
source 'https://rubygems.org'
66

77
gem 'activemodel', '~> 6.0.0'
8+
gem 'base64'
9+
gem 'bigdecimal'
10+
gem 'mutex_m'
811
gem 'pry-byebug', platforms: :ruby
912

1013
gemspec path: '../'

gemfiles/rails_6_1.gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
source 'https://rubygems.org'
66

77
gem 'activemodel', '~> 6.1.0'
8+
gem 'base64'
9+
gem 'bigdecimal'
10+
gem 'mutex_m'
811
gem 'pry-byebug', platforms: :ruby
912

1013
gemspec path: '../'

gemfiles/rails_7_0.gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
source 'https://rubygems.org'
66

77
gem 'activemodel', '~> 7.0.2'
8+
gem 'base64'
9+
gem 'bigdecimal'
10+
gem 'mutex_m'
811
gem 'pry-byebug', platforms: :ruby
912

1013
gemspec path: '../'

gemfiles/rails_7_1.gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
source 'https://rubygems.org'
66

77
gem 'activemodel', '~> 7.1.0'
8+
gem 'base64'
9+
gem 'bigdecimal'
10+
gem 'mutex_m'
811
gem 'pry-byebug', platforms: :ruby
912

1013
gemspec path: '../'

gemfiles/rails_7_2.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source 'https://rubygems.org'
6+
7+
gem 'activemodel', '~> 7.2.0'
8+
gem 'base64'
9+
gem 'bigdecimal'
10+
gem 'mutex_m'
11+
gem 'pry-byebug', platforms: :ruby
12+
13+
gemspec path: '../'

gemfiles/rails_8_0.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
# This file was generated by Appraisal
4+
5+
source 'https://rubygems.org'
6+
7+
gem 'activemodel', '~> 8.0.0'
8+
gem 'base64'
9+
gem 'bigdecimal'
10+
gem 'mutex_m'
11+
gem 'pry-byebug', platforms: :ruby
12+
13+
gemspec path: '../'

lib/dynamoid.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,10 @@ def included_models
6363
def adapter
6464
@adapter ||= Adapter.new
6565
end
66+
67+
# @private
68+
def deprecator
69+
# all the deprecated behavior will be removed in the next major version
70+
@deprecator ||= ActiveSupport::Deprecation.new('4.0', 'Dynamoid')
71+
end
6672
end

lib/dynamoid/finders.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def find(*ids, **options)
7878
# # Find all the tweets using hash key and range key with consistent read
7979
# Tweet.find_all([['1', 'red'], ['1', 'green']], consistent_read: true)
8080
def find_all(ids, options = {})
81-
ActiveSupport::Deprecation.warn('[Dynamoid] .find_all is deprecated! Call .find instead of')
81+
Dynamoid.deprecator.warn('[Dynamoid] .find_all is deprecated! Call .find instead of')
8282

8383
_find_all(ids, options)
8484
end
@@ -100,7 +100,7 @@ def find_all(ids, options = {})
100100
#
101101
# @since 0.2.0
102102
def find_by_id(id, options = {})
103-
ActiveSupport::Deprecation.warn('[Dynamoid] .find_by_id is deprecated! Call .find instead of', caller[1..-1])
103+
Dynamoid.deprecator.warn('[Dynamoid] .find_by_id is deprecated! Call .find instead of')
104104

105105
_find_by_id(id, options)
106106
end
@@ -180,7 +180,7 @@ def _find_by_id(id, options = {})
180180
# @param range_key [Scalar value] range key of the object to find
181181
#
182182
def find_by_composite_key(hash_key, range_key, options = {})
183-
ActiveSupport::Deprecation.warn('[Dynamoid] .find_by_composite_key is deprecated! Call .find instead of')
183+
Dynamoid.deprecator.warn('[Dynamoid] .find_by_composite_key is deprecated! Call .find instead of')
184184

185185
_find_by_id(hash_key, options.merge(range_key: range_key))
186186
end
@@ -207,7 +207,7 @@ def find_by_composite_key(hash_key, range_key, options = {})
207207
#
208208
# @return [Array] an array of all matching items
209209
def find_all_by_composite_key(hash_key, options = {})
210-
ActiveSupport::Deprecation.warn('[Dynamoid] .find_all_composite_key is deprecated! Call .where instead of')
210+
Dynamoid.deprecator.warn('[Dynamoid] .find_all_composite_key is deprecated! Call .where instead of')
211211

212212
Dynamoid.adapter.query(table_name, options.merge(hash_value: hash_key)).flat_map { |i| i }.collect do |item|
213213
from_database(item)
@@ -237,7 +237,7 @@ def find_all_by_composite_key(hash_key, options = {})
237237
# @param options [Hash] conditions on range key e.g. +{ "rank.lte": 10 }, query filter, projected keys, scan_index_forward etc.
238238
# @return [Array] an array of all matching items
239239
def find_all_by_secondary_index(hash, options = {})
240-
ActiveSupport::Deprecation.warn('[Dynamoid] .find_all_by_secondary_index is deprecated! Call .where instead of')
240+
Dynamoid.deprecator.warn('[Dynamoid] .find_all_by_secondary_index is deprecated! Call .where instead of')
241241

242242
range = options[:range] || {}
243243
hash_key_field, hash_key_value = hash.first
@@ -291,7 +291,7 @@ def find_all_by_secondary_index(hash, options = {})
291291
def method_missing(method, *args)
292292
# Cannot use Symbol#start_with? because it was introduced in Ruby 2.7, but we support Ruby >= 2.3
293293
if method.to_s.start_with?('find')
294-
ActiveSupport::Deprecation.warn("[Dynamoid] .#{method} is deprecated! Call .where instead of")
294+
Dynamoid.deprecator.warn("[Dynamoid] .#{method} is deprecated! Call .where instead of")
295295

296296
finder = method.to_s.split('_by_').first
297297
attributes = method.to_s.split('_by_').last.split('_and_')

0 commit comments

Comments
 (0)