active_attr 0.15.4 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c15f00f2cfc6c6ffdfd40c5ceb03c5f352b035e48b64f8b94ba021eafebf47f9
4
- data.tar.gz: '09cb76b33a15ccd8db66d1ce1d82c194eb78a9272ff3dfbda9463fd691514a02'
3
+ metadata.gz: d9ea6729adf0c1470577fed7da5493cee0249ed2e2766b85cd3cad5f4d9a0771
4
+ data.tar.gz: d76ff3748248f2fd8d84d3c2a1f74a94e318a5cbd5fc938a2675fccb6fbd59ef
5
5
  SHA512:
6
- metadata.gz: 4c76b578e6b83c4fd79bc6c3db708a724f8b8d258ea376022da7fced32449ed07b428bbcc8c06cb5783fde3b6533dc827af75185afeaa19214daf7e33ba36dbe
7
- data.tar.gz: c65dd72971455398ca158bd99403dea24ac14d5de945b1d45b7250fcaad21c07b90128ae6cec0f764ccd1306c20f02eb427e9ced66c7f295e2260abd08a0944d
6
+ metadata.gz: 2cbe7483462f6b7ee9112aabbdbffd12947854464d521366f5baeefdacc305ff3e1ebcaed444a7686bb4ed346be2d84f69dc4699f03709cf2586f0a208475efa
7
+ data.tar.gz: 4bb735d2109116c047215f5c0cc4d2673ddebdd125b22427b53434e9e4a5f8cb9ef58cb6124bf68e8d5d9de618529a0c076d021126f4d53a70c9456b2615918d
@@ -9,20 +9,22 @@ on:
9
9
  jobs:
10
10
  test:
11
11
  name: Ruby ${{ matrix.ruby }} with ${{ matrix.gemfile }}
12
- runs-on: ubuntu-latest
12
+ runs-on: ubuntu-20.04
13
13
  continue-on-error: ${{ contains(matrix.ruby, 'head') || contains(matrix.gemfile, 'head') }}
14
14
  strategy:
15
15
  fail-fast: false
16
16
  matrix:
17
17
  ruby:
18
- - 2.1.9
19
- - 2.2.10
20
- - 2.3.8
21
- - 2.4.10
22
- - 2.5.9
23
- - 2.6.8
24
- - 2.7.4
25
- - 3.0.2
18
+ - "2.1"
19
+ - "2.2"
20
+ - "2.3"
21
+ - "2.4"
22
+ - "2.5"
23
+ - "2.6"
24
+ - "2.7"
25
+ - "3.0"
26
+ - "3.1"
27
+ - "3.2"
26
28
  - truffleruby-head
27
29
  gemfile:
28
30
  - gemfiles/rails_3_0.gemfile
@@ -36,140 +38,141 @@ jobs:
36
38
  - gemfiles/rails_5_2.gemfile
37
39
  - gemfiles/rails_6_0.gemfile
38
40
  - gemfiles/rails_6_1.gemfile
41
+ - gemfiles/rails_7_0.gemfile
39
42
  - Gemfile
40
43
  - gemfiles/rails_head.gemfile
41
44
  exclude:
42
- - ruby: 1.9.2
43
- gemfile: gemfiles/rails_4_0.gemfile
44
- - ruby: 1.9.2
45
- gemfile: gemfiles/rails_4_1.gemfile
46
- - ruby: 1.9.2
47
- gemfile: gemfiles/rails_4_2.gemfile
48
- - ruby: 1.9.2
49
- gemfile: gemfiles/rails_5_0.gemfile
50
- - ruby: 1.9.2
51
- gemfile: gemfiles/rails_5_1.gemfile
52
- - ruby: 1.9.2
53
- gemfile: gemfiles/rails_5_2.gemfile
54
- - ruby: 1.9.2
55
- gemfile: gemfiles/rails_6_0.gemfile
56
- - ruby: 1.9.2
57
- gemfile: gemfiles/rails_6_1.gemfile
58
- - ruby: 1.9.2
59
- gemfile: Gemfile
60
- - ruby: 1.9.2
61
- gemfile: gemfiles/rails_head.gemfile
62
- - ruby: 1.9.3
63
- gemfile: gemfiles/rails_5_0.gemfile
64
- - ruby: 1.9.3
65
- gemfile: gemfiles/rails_5_1.gemfile
66
- - ruby: 1.9.3
67
- gemfile: gemfiles/rails_5_2.gemfile
68
- - ruby: 1.9.3
69
- gemfile: gemfiles/rails_6_0.gemfile
70
- - ruby: 1.9.3
71
- gemfile: gemfiles/rails_6_1.gemfile
72
- - ruby: 1.9.3
73
- gemfile: Gemfile
74
- - ruby: 1.9.3
75
- gemfile: gemfiles/rails_head.gemfile
76
- - ruby: 2.0.0
77
- gemfile: gemfiles/rails_5_0.gemfile
78
- - ruby: 2.0.0
79
- gemfile: gemfiles/rails_5_1.gemfile
80
- - ruby: 2.0.0
81
- gemfile: gemfiles/rails_5_2.gemfile
82
- - ruby: 2.0.0
83
- gemfile: gemfiles/rails_6_0.gemfile
84
- - ruby: 2.0.0
85
- gemfile: gemfiles/rails_6_1.gemfile
86
- - ruby: 2.0.0
87
- gemfile: Gemfile
88
- - ruby: 2.0.0
89
- gemfile: gemfiles/rails_head.gemfile
90
- - ruby: 2.1.9
45
+ - ruby: "2.1"
91
46
  gemfile: gemfiles/rails_5_0.gemfile
92
- - ruby: 2.1.9
47
+ - ruby: "2.1"
93
48
  gemfile: gemfiles/rails_5_1.gemfile
94
- - ruby: 2.1.9
49
+ - ruby: "2.1"
95
50
  gemfile: gemfiles/rails_5_2.gemfile
96
- - ruby: 2.1.9
51
+ - ruby: "2.1"
97
52
  gemfile: gemfiles/rails_6_0.gemfile
98
- - ruby: 2.1.9
53
+ - ruby: "2.1"
99
54
  gemfile: gemfiles/rails_6_1.gemfile
100
- - ruby: 2.1.9
55
+ - ruby: "2.1"
56
+ gemfile: gemfiles/rails_7_0.gemfile
57
+ - ruby: "2.1"
101
58
  gemfile: Gemfile
102
- - ruby: 2.1.9
59
+ - ruby: "2.1"
103
60
  gemfile: gemfiles/rails_head.gemfile
104
- - ruby: 2.2.10
61
+ - ruby: "2.2"
105
62
  gemfile: gemfiles/rails_6_0.gemfile
106
- - ruby: 2.2.10
63
+ - ruby: "2.2"
107
64
  gemfile: gemfiles/rails_6_1.gemfile
108
- - ruby: 2.2.10
65
+ - ruby: "2.2"
66
+ gemfile: gemfiles/rails_7_0.gemfile
67
+ - ruby: "2.2"
109
68
  gemfile: Gemfile
110
- - ruby: 2.2.10
69
+ - ruby: "2.2"
111
70
  gemfile: gemfiles/rails_head.gemfile
112
- - ruby: 2.3.8
71
+ - ruby: "2.3"
113
72
  gemfile: gemfiles/rails_6_0.gemfile
114
- - ruby: 2.3.8
73
+ - ruby: "2.3"
115
74
  gemfile: gemfiles/rails_6_1.gemfile
116
- - ruby: 2.3.8
75
+ - ruby: "2.3"
76
+ gemfile: gemfiles/rails_7_0.gemfile
77
+ - ruby: "2.3"
117
78
  gemfile: Gemfile
118
- - ruby: 2.3.8
79
+ - ruby: "2.3"
119
80
  gemfile: gemfiles/rails_head.gemfile
120
- - ruby: 2.4.10
81
+ - ruby: "2.4"
121
82
  gemfile: gemfiles/rails_6_0.gemfile
122
- - ruby: 2.4.10
83
+ - ruby: "2.4"
123
84
  gemfile: gemfiles/rails_6_1.gemfile
124
- - ruby: 2.4.10
85
+ - ruby: "2.4"
86
+ gemfile: gemfiles/rails_7_0.gemfile
87
+ - ruby: "2.4"
125
88
  gemfile: Gemfile
126
- - ruby: 2.4.10
89
+ - ruby: "2.4"
127
90
  gemfile: gemfiles/rails_head.gemfile
128
- - ruby: 2.5.9
91
+ - ruby: "2.5"
129
92
  gemfile: gemfiles/rails_3_0.gemfile
130
- - ruby: 2.5.9
93
+ - ruby: "2.5"
131
94
  gemfile: gemfiles/rails_6_1.gemfile
132
- - ruby: 2.5.9
95
+ - ruby: "2.5"
96
+ gemfile: gemfiles/rails_7_0.gemfile
97
+ - ruby: "2.5"
133
98
  gemfile: Gemfile
134
- - ruby: 2.5.9
99
+ - ruby: "2.5"
135
100
  gemfile: gemfiles/rails_head.gemfile
136
- - ruby: 2.6.8
101
+ - ruby: "2.6"
137
102
  gemfile: gemfiles/rails_3_0.gemfile
138
- - ruby: 2.6.8
103
+ - ruby: "2.6"
139
104
  gemfile: gemfiles/rails_6_1.gemfile
140
- - ruby: 2.6.8
105
+ - ruby: "2.6"
106
+ gemfile: gemfiles/rails_7_0.gemfile
107
+ - ruby: "2.6"
141
108
  gemfile: Gemfile
142
- - ruby: 2.6.8
109
+ - ruby: "2.6"
143
110
  gemfile: gemfiles/rails_head.gemfile
144
- - ruby: 2.7.4
111
+ - ruby: "2.7"
145
112
  gemfile: gemfiles/rails_3_0.gemfile
146
- - ruby: 2.7.4
113
+ - ruby: "2.7"
147
114
  gemfile: gemfiles/rails_3_1.gemfile
148
- - ruby: 2.7.4
115
+ - ruby: "2.7"
149
116
  gemfile: gemfiles/rails_3_2.gemfile
150
- - ruby: 2.7.4
117
+ - ruby: "2.7"
151
118
  gemfile: gemfiles/rails_4_0.gemfile
152
- - ruby: 2.7.4
119
+ - ruby: "2.7"
153
120
  gemfile: gemfiles/rails_4_1.gemfile
154
- - ruby: 2.7.4
121
+ - ruby: "2.7"
155
122
  gemfile: gemfiles/rails_4_2.gemfile
156
- - ruby: 3.0.2
123
+ - ruby: "3.0"
157
124
  gemfile: gemfiles/rails_3_0.gemfile
158
- - ruby: 3.0.2
125
+ - ruby: "3.0"
159
126
  gemfile: gemfiles/rails_3_1.gemfile
160
- - ruby: 3.0.2
127
+ - ruby: "3.0"
161
128
  gemfile: gemfiles/rails_3_2.gemfile
162
- - ruby: 3.0.2
129
+ - ruby: "3.0"
163
130
  gemfile: gemfiles/rails_4_0.gemfile
164
- - ruby: 3.0.2
131
+ - ruby: "3.0"
165
132
  gemfile: gemfiles/rails_4_1.gemfile
166
- - ruby: 3.0.2
133
+ - ruby: "3.0"
167
134
  gemfile: gemfiles/rails_4_2.gemfile
168
- - ruby: 3.0.2
135
+ - ruby: "3.0"
169
136
  gemfile: gemfiles/rails_5_0.gemfile
170
- - ruby: 3.0.2
137
+ - ruby: "3.0"
171
138
  gemfile: gemfiles/rails_5_1.gemfile
172
- - ruby: 3.0.2
139
+ - ruby: "3.0"
140
+ gemfile: gemfiles/rails_5_2.gemfile
141
+ - ruby: "3.1"
142
+ gemfile: gemfiles/rails_3_0.gemfile
143
+ - ruby: "3.1"
144
+ gemfile: gemfiles/rails_3_1.gemfile
145
+ - ruby: "3.1"
146
+ gemfile: gemfiles/rails_3_2.gemfile
147
+ - ruby: "3.1"
148
+ gemfile: gemfiles/rails_4_0.gemfile
149
+ - ruby: "3.1"
150
+ gemfile: gemfiles/rails_4_1.gemfile
151
+ - ruby: "3.1"
152
+ gemfile: gemfiles/rails_4_2.gemfile
153
+ - ruby: "3.1"
154
+ gemfile: gemfiles/rails_5_0.gemfile
155
+ - ruby: "3.1"
156
+ gemfile: gemfiles/rails_5_1.gemfile
157
+ - ruby: "3.1"
158
+ gemfile: gemfiles/rails_5_2.gemfile
159
+ - ruby: "3.2"
160
+ gemfile: gemfiles/rails_3_0.gemfile
161
+ - ruby: "3.2"
162
+ gemfile: gemfiles/rails_3_1.gemfile
163
+ - ruby: "3.2"
164
+ gemfile: gemfiles/rails_3_2.gemfile
165
+ - ruby: "3.2"
166
+ gemfile: gemfiles/rails_4_0.gemfile
167
+ - ruby: "3.2"
168
+ gemfile: gemfiles/rails_4_1.gemfile
169
+ - ruby: "3.2"
170
+ gemfile: gemfiles/rails_4_2.gemfile
171
+ - ruby: "3.2"
172
+ gemfile: gemfiles/rails_5_0.gemfile
173
+ - ruby: "3.2"
174
+ gemfile: gemfiles/rails_5_1.gemfile
175
+ - ruby: "3.2"
173
176
  gemfile: gemfiles/rails_5_2.gemfile
174
177
  - ruby: truffleruby-head
175
178
  gemfile: gemfiles/rails_3_0.gemfile
@@ -183,13 +186,19 @@ jobs:
183
186
  gemfile: gemfiles/rails_4_1.gemfile
184
187
  - ruby: truffleruby-head
185
188
  gemfile: gemfiles/rails_4_2.gemfile
189
+ - ruby: truffleruby-head
190
+ gemfile: gemfiles/rails_5_0.gemfile
191
+ - ruby: truffleruby-head
192
+ gemfile: gemfiles/rails_5_1.gemfile
193
+ - ruby: truffleruby-head
194
+ gemfile: gemfiles/rails_5_2.gemfile
186
195
  env:
187
196
  Rails: ${{ matrix.rails }}
188
197
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
189
198
 
190
199
  steps:
191
200
  - name: Checkout code
192
- uses: actions/checkout@master
201
+ uses: actions/checkout@v4
193
202
  - name: Nokogiri support for TruffleRuby
194
203
  run: sudo apt-get -yqq install libxml2-dev libxslt-dev
195
204
  if: ${{ matrix.ruby == 'truffleruby-head' }}
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- # ActiveAttr 0.15.3 (December 16, 2021)
1
+ # ActiveAttr 0.16.0 (October 30, 2023)
2
+
3
+ * ActiveAttr now supports Ruby 3.1
4
+ * ActiveAttr now supports Ruby 3.2
5
+ * ActiveAttr now supports Rails 7.1 (thanks @mathieujobin)
6
+
7
+ # ActiveAttr 0.15.4 (December 16, 2021)
2
8
 
3
9
  * ActiveAttr now supports Rails 7.0 (Steve Hoeksema)
4
10
 
data/Gemfile CHANGED
@@ -2,9 +2,9 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec :development_group => :test
4
4
 
5
- gem "activemodel", "~> 7.0.0"
6
- gem "activesupport", "~> 7.0.0"
7
- gem "actionpack", "~> 7.0.0"
5
+ gem "activemodel", "~> 7.1.0"
6
+ gem "activesupport", "~> 7.1.0"
7
+ gem "actionpack", "~> 7.1.0"
8
8
  gem "activemodel-serializers-xml", :group => :test
9
9
  gem "rexml", :group => :test
10
10
  gem "protected_attributes_continued", :group => :test
data/active_attr.gemspec CHANGED
@@ -22,9 +22,9 @@ Gem::Specification.new do |gem|
22
22
 
23
23
  gem.required_ruby_version = ">= 2.1.0"
24
24
 
25
- gem.add_runtime_dependency "actionpack", ">= 3.0.2", "< 7.1"
26
- gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 7.1"
27
- gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 7.1"
25
+ gem.add_runtime_dependency "actionpack", ">= 3.0.2", "< 7.2"
26
+ gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 7.2"
27
+ gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 7.2"
28
28
 
29
29
  gem.add_development_dependency "bundler"
30
30
  gem.add_development_dependency "factory_bot", "< 5.0"
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec :development_group => :test, :path => ".."
4
+
5
+ gem "activemodel", "~> 7.0.0"
6
+ gem "activesupport", "~> 7.0.0"
7
+ gem "actionpack", "~> 7.0.0"
8
+ gem "activemodel-serializers-xml", :group => :test
9
+ gem "rexml", :group => :test
10
+ gem "protected_attributes_continued", :group => :test
@@ -2,13 +2,13 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec :development_group => :test, :path => ".."
4
4
 
5
- git "git://github.com/rails/rails.git", :branch => "main" do
5
+ git "https://github.com/rails/rails.git", :branch => "main" do
6
6
  gem "activemodel"
7
7
  gem "activesupport"
8
8
  gem "actionpack"
9
9
  end
10
10
 
11
- gem "activemodel-serializers-xml", :group => :test, :git => "git://github.com/rails/activemodel-serializers-xml.git"
11
+ gem "activemodel-serializers-xml", :group => :test, :git => "https://github.com/rails/activemodel-serializers-xml.git"
12
12
  gem "rexml", :group => :test
13
- gem "protected_attributes_continued", :group => :test, :git => "git://github.com/westonganger/protected_attributes_continued"
14
- gem "rack", :group => :test, :git => "git://github.com/rack/rack.git"
13
+ gem "protected_attributes_continued", :group => :test, :git => "https://github.com/westonganger/protected_attributes_continued.git"
14
+ gem "rack", :group => :test, :git => "https://github.com/rack/rack.git", :branch => "main"
@@ -66,7 +66,7 @@ module ActiveAttr
66
66
  class_attribute :filter_attributes, :instance_writer => false
67
67
  self.filter_attributes = Attributes.filter_attributes
68
68
 
69
- attribute_method_suffix "" if attribute_method_matchers.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" }
69
+ attribute_method_suffix "" if attribute_method_patterns.none? { |matcher| matcher.prefix == "" && matcher.suffix == "" }
70
70
  attribute_method_suffix "="
71
71
  end
72
72
 
@@ -323,6 +323,14 @@ module ActiveAttr
323
323
  "#{name}#{attributes_list}"
324
324
  end
325
325
 
326
+ # Renamed in ActiveModel 7.1
327
+ #
328
+ # @private
329
+ # @since 0.16.0
330
+ def attribute_method_patterns
331
+ attribute_method_matchers
332
+ end unless method_defined?(:attribute_method_patterns)
333
+
326
334
  protected
327
335
 
328
336
  # Assign a set of attribute definitions, used when subclassing models
@@ -346,7 +354,7 @@ module ActiveAttr
346
354
  #
347
355
  # @since 0.6.0
348
356
  def attribute_methods(name)
349
- attribute_method_matchers.map { |matcher| matcher.method_name name }
357
+ attribute_method_patterns.map { |matcher| matcher.method_name name }
350
358
  end
351
359
 
352
360
  # Ruby inherited hook to assign superclass attributes to subclasses
@@ -1,5 +1,5 @@
1
1
  module ActiveAttr
2
2
  # Complete version string
3
3
  # @since 0.1.0
4
- VERSION = "0.15.4"
4
+ VERSION = "0.16.0"
5
5
  end
@@ -211,7 +211,7 @@ module ActiveAttr
211
211
  end
212
212
 
213
213
  it "returns false when compared to another type" do
214
- should_not == Struct.new(:attributes).new("first_name" => "Ben")
214
+ should_not == Struct.new(:attributes).new({ "first_name" => "Ben" })
215
215
  end
216
216
  end
217
217
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_attr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.4
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Griego
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-16 00:00:00.000000000 Z
12
+ date: 2023-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: 3.0.2
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '7.1'
23
+ version: '7.2'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: 3.0.2
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.1'
33
+ version: '7.2'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activemodel
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: 3.0.2
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '7.1'
43
+ version: '7.2'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: 3.0.2
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '7.1'
53
+ version: '7.2'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: activesupport
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -60,7 +60,7 @@ dependencies:
60
60
  version: 3.0.2
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
- version: '7.1'
63
+ version: '7.2'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
@@ -70,7 +70,7 @@ dependencies:
70
70
  version: 3.0.2
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
- version: '7.1'
73
+ version: '7.2'
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: bundler
76
76
  requirement: !ruby/object:Gem::Requirement
@@ -191,6 +191,7 @@ files:
191
191
  - gemfiles/rails_5_2.gemfile
192
192
  - gemfiles/rails_6_0.gemfile
193
193
  - gemfiles/rails_6_1.gemfile
194
+ - gemfiles/rails_7_0.gemfile
194
195
  - gemfiles/rails_head.gemfile
195
196
  - lib/active_attr.rb
196
197
  - lib/active_attr/attribute_defaults.rb
@@ -284,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
285
  - !ruby/object:Gem::Version
285
286
  version: '0'
286
287
  requirements: []
287
- rubygems_version: 3.1.2
288
+ rubygems_version: 3.4.1
288
289
  signing_key:
289
290
  specification_version: 4
290
291
  summary: What ActiveModel left out