active_attr 0.15.3 → 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: 46cc15076eb772185aa186a1ad3b9f4d30a248ab2590a3313aee50234b88ad4a
4
- data.tar.gz: 42ee4c91d0aa84ead0ec86bc4eb7b1e8ea552e473ee5186e365729cae151291b
3
+ metadata.gz: d9ea6729adf0c1470577fed7da5493cee0249ed2e2766b85cd3cad5f4d9a0771
4
+ data.tar.gz: d76ff3748248f2fd8d84d3c2a1f74a94e318a5cbd5fc938a2675fccb6fbd59ef
5
5
  SHA512:
6
- metadata.gz: 1d2e5e08442875430c1ebfb70a2456a212a2bb10526cb7c15713809cd92f9ad9959b9c0a9b5462715bb83fcd692f03fe841967ce766b5304c56d68414c66be15
7
- data.tar.gz: 5d2b4c6bdd36b342fc32f709741577bb896e3e125834f96a7c81617ea8424b9d2a58fe819ea998d4e2b5bc71089e4c13140099140181a544be6385e2dfefe22d
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.8
23
- - 2.6.6
24
- - 2.7.2
25
- - 3.0.0
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
@@ -35,118 +37,142 @@ jobs:
35
37
  - gemfiles/rails_5_1.gemfile
36
38
  - gemfiles/rails_5_2.gemfile
37
39
  - gemfiles/rails_6_0.gemfile
40
+ - gemfiles/rails_6_1.gemfile
41
+ - gemfiles/rails_7_0.gemfile
38
42
  - Gemfile
39
43
  - gemfiles/rails_head.gemfile
40
44
  exclude:
41
- - ruby: 1.9.2
42
- gemfile: gemfiles/rails_4_0.gemfile
43
- - ruby: 1.9.2
44
- gemfile: gemfiles/rails_4_1.gemfile
45
- - ruby: 1.9.2
46
- gemfile: gemfiles/rails_4_2.gemfile
47
- - ruby: 1.9.2
45
+ - ruby: "2.1"
48
46
  gemfile: gemfiles/rails_5_0.gemfile
49
- - ruby: 1.9.2
47
+ - ruby: "2.1"
50
48
  gemfile: gemfiles/rails_5_1.gemfile
51
- - ruby: 1.9.2
49
+ - ruby: "2.1"
52
50
  gemfile: gemfiles/rails_5_2.gemfile
53
- - ruby: 1.9.2
51
+ - ruby: "2.1"
54
52
  gemfile: gemfiles/rails_6_0.gemfile
55
- - ruby: 1.9.2
53
+ - ruby: "2.1"
54
+ gemfile: gemfiles/rails_6_1.gemfile
55
+ - ruby: "2.1"
56
+ gemfile: gemfiles/rails_7_0.gemfile
57
+ - ruby: "2.1"
56
58
  gemfile: Gemfile
57
- - ruby: 1.9.2
59
+ - ruby: "2.1"
58
60
  gemfile: gemfiles/rails_head.gemfile
59
- - ruby: 1.9.3
60
- gemfile: gemfiles/rails_5_0.gemfile
61
- - ruby: 1.9.3
62
- gemfile: gemfiles/rails_5_1.gemfile
63
- - ruby: 1.9.3
64
- gemfile: gemfiles/rails_5_2.gemfile
65
- - ruby: 1.9.3
66
- gemfile: gemfiles/rails_6_0.gemfile
67
- - ruby: 1.9.3
68
- gemfile: Gemfile
69
- - ruby: 1.9.3
70
- gemfile: gemfiles/rails_head.gemfile
71
- - ruby: 2.0.0
72
- gemfile: gemfiles/rails_5_0.gemfile
73
- - ruby: 2.0.0
74
- gemfile: gemfiles/rails_5_1.gemfile
75
- - ruby: 2.0.0
76
- gemfile: gemfiles/rails_5_2.gemfile
77
- - ruby: 2.0.0
61
+ - ruby: "2.2"
78
62
  gemfile: gemfiles/rails_6_0.gemfile
79
- - ruby: 2.0.0
63
+ - ruby: "2.2"
64
+ gemfile: gemfiles/rails_6_1.gemfile
65
+ - ruby: "2.2"
66
+ gemfile: gemfiles/rails_7_0.gemfile
67
+ - ruby: "2.2"
80
68
  gemfile: Gemfile
81
- - ruby: 2.0.0
69
+ - ruby: "2.2"
82
70
  gemfile: gemfiles/rails_head.gemfile
83
- - ruby: 2.1.9
84
- gemfile: gemfiles/rails_5_0.gemfile
85
- - ruby: 2.1.9
86
- gemfile: gemfiles/rails_5_1.gemfile
87
- - ruby: 2.1.9
88
- gemfile: gemfiles/rails_5_2.gemfile
89
- - ruby: 2.1.9
71
+ - ruby: "2.3"
90
72
  gemfile: gemfiles/rails_6_0.gemfile
91
- - ruby: 2.1.9
73
+ - ruby: "2.3"
74
+ gemfile: gemfiles/rails_6_1.gemfile
75
+ - ruby: "2.3"
76
+ gemfile: gemfiles/rails_7_0.gemfile
77
+ - ruby: "2.3"
92
78
  gemfile: Gemfile
93
- - ruby: 2.1.9
79
+ - ruby: "2.3"
94
80
  gemfile: gemfiles/rails_head.gemfile
95
- - ruby: 2.2.10
81
+ - ruby: "2.4"
96
82
  gemfile: gemfiles/rails_6_0.gemfile
97
- - ruby: 2.2.10
83
+ - ruby: "2.4"
84
+ gemfile: gemfiles/rails_6_1.gemfile
85
+ - ruby: "2.4"
86
+ gemfile: gemfiles/rails_7_0.gemfile
87
+ - ruby: "2.4"
98
88
  gemfile: Gemfile
99
- - ruby: 2.2.10
89
+ - ruby: "2.4"
100
90
  gemfile: gemfiles/rails_head.gemfile
101
- - ruby: 2.3.8
102
- gemfile: gemfiles/rails_6_0.gemfile
103
- - ruby: 2.3.8
91
+ - ruby: "2.5"
92
+ gemfile: gemfiles/rails_3_0.gemfile
93
+ - ruby: "2.5"
94
+ gemfile: gemfiles/rails_6_1.gemfile
95
+ - ruby: "2.5"
96
+ gemfile: gemfiles/rails_7_0.gemfile
97
+ - ruby: "2.5"
104
98
  gemfile: Gemfile
105
- - ruby: 2.3.8
99
+ - ruby: "2.5"
106
100
  gemfile: gemfiles/rails_head.gemfile
107
- - ruby: 2.4.10
108
- gemfile: gemfiles/rails_6_0.gemfile
109
- - ruby: 2.4.10
101
+ - ruby: "2.6"
102
+ gemfile: gemfiles/rails_3_0.gemfile
103
+ - ruby: "2.6"
104
+ gemfile: gemfiles/rails_6_1.gemfile
105
+ - ruby: "2.6"
106
+ gemfile: gemfiles/rails_7_0.gemfile
107
+ - ruby: "2.6"
110
108
  gemfile: Gemfile
111
- - ruby: 2.4.10
109
+ - ruby: "2.6"
112
110
  gemfile: gemfiles/rails_head.gemfile
113
- - ruby: 2.5.8
111
+ - ruby: "2.7"
114
112
  gemfile: gemfiles/rails_3_0.gemfile
115
- - ruby: 2.5.8
116
- gemfile: gemfiles/rails_head.gemfile
117
- - ruby: 2.6.6
113
+ - ruby: "2.7"
114
+ gemfile: gemfiles/rails_3_1.gemfile
115
+ - ruby: "2.7"
116
+ gemfile: gemfiles/rails_3_2.gemfile
117
+ - ruby: "2.7"
118
+ gemfile: gemfiles/rails_4_0.gemfile
119
+ - ruby: "2.7"
120
+ gemfile: gemfiles/rails_4_1.gemfile
121
+ - ruby: "2.7"
122
+ gemfile: gemfiles/rails_4_2.gemfile
123
+ - ruby: "3.0"
118
124
  gemfile: gemfiles/rails_3_0.gemfile
119
- - ruby: 2.6.6
120
- gemfile: gemfiles/rails_head.gemfile
121
- - ruby: 2.7.2
125
+ - ruby: "3.0"
126
+ gemfile: gemfiles/rails_3_1.gemfile
127
+ - ruby: "3.0"
128
+ gemfile: gemfiles/rails_3_2.gemfile
129
+ - ruby: "3.0"
130
+ gemfile: gemfiles/rails_4_0.gemfile
131
+ - ruby: "3.0"
132
+ gemfile: gemfiles/rails_4_1.gemfile
133
+ - ruby: "3.0"
134
+ gemfile: gemfiles/rails_4_2.gemfile
135
+ - ruby: "3.0"
136
+ gemfile: gemfiles/rails_5_0.gemfile
137
+ - ruby: "3.0"
138
+ gemfile: gemfiles/rails_5_1.gemfile
139
+ - ruby: "3.0"
140
+ gemfile: gemfiles/rails_5_2.gemfile
141
+ - ruby: "3.1"
122
142
  gemfile: gemfiles/rails_3_0.gemfile
123
- - ruby: 2.7.2
143
+ - ruby: "3.1"
124
144
  gemfile: gemfiles/rails_3_1.gemfile
125
- - ruby: 2.7.2
145
+ - ruby: "3.1"
126
146
  gemfile: gemfiles/rails_3_2.gemfile
127
- - ruby: 2.7.2
147
+ - ruby: "3.1"
128
148
  gemfile: gemfiles/rails_4_0.gemfile
129
- - ruby: 2.7.2
149
+ - ruby: "3.1"
130
150
  gemfile: gemfiles/rails_4_1.gemfile
131
- - ruby: 2.7.2
151
+ - ruby: "3.1"
132
152
  gemfile: gemfiles/rails_4_2.gemfile
133
- - ruby: 3.0.0
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"
134
160
  gemfile: gemfiles/rails_3_0.gemfile
135
- - ruby: 3.0.0
161
+ - ruby: "3.2"
136
162
  gemfile: gemfiles/rails_3_1.gemfile
137
- - ruby: 3.0.0
163
+ - ruby: "3.2"
138
164
  gemfile: gemfiles/rails_3_2.gemfile
139
- - ruby: 3.0.0
165
+ - ruby: "3.2"
140
166
  gemfile: gemfiles/rails_4_0.gemfile
141
- - ruby: 3.0.0
167
+ - ruby: "3.2"
142
168
  gemfile: gemfiles/rails_4_1.gemfile
143
- - ruby: 3.0.0
169
+ - ruby: "3.2"
144
170
  gemfile: gemfiles/rails_4_2.gemfile
145
- - ruby: 3.0.0
171
+ - ruby: "3.2"
146
172
  gemfile: gemfiles/rails_5_0.gemfile
147
- - ruby: 3.0.0
173
+ - ruby: "3.2"
148
174
  gemfile: gemfiles/rails_5_1.gemfile
149
- - ruby: 3.0.0
175
+ - ruby: "3.2"
150
176
  gemfile: gemfiles/rails_5_2.gemfile
151
177
  - ruby: truffleruby-head
152
178
  gemfile: gemfiles/rails_3_0.gemfile
@@ -160,13 +186,19 @@ jobs:
160
186
  gemfile: gemfiles/rails_4_1.gemfile
161
187
  - ruby: truffleruby-head
162
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
163
195
  env:
164
196
  Rails: ${{ matrix.rails }}
165
197
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
166
198
 
167
199
  steps:
168
200
  - name: Checkout code
169
- uses: actions/checkout@master
201
+ uses: actions/checkout@v4
170
202
  - name: Nokogiri support for TruffleRuby
171
203
  run: sudo apt-get -yqq install libxml2-dev libxslt-dev
172
204
  if: ${{ matrix.ruby == 'truffleruby-head' }}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
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)
8
+
9
+ * ActiveAttr now supports Rails 7.0 (Steve Hoeksema)
10
+
1
11
  # ActiveAttr 0.15.3 (April 12, 2021)
2
12
 
3
13
  * #185 Fixed ReDoS vulnerability in BooleanTypecaster#call (ねず)
data/Gemfile CHANGED
@@ -2,9 +2,9 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec :development_group => :test
4
4
 
5
- gem "activemodel", "~> 6.1.0"
6
- gem "activesupport", "~> 6.1.0"
7
- gem "actionpack", "~> 6.1.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.0"
26
- gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 7.0"
27
- gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 7.0"
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", "~> 6.1.0"
6
+ gem "activesupport", "~> 6.1.0"
7
+ gem "actionpack", "~> 6.1.0"
8
+ gem "activemodel-serializers-xml", :group => :test
9
+ gem "rexml", :group => :test
10
+ gem "protected_attributes_continued", :group => :test
@@ -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.3"
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.3
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-04-12 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.0'
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.0'
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.0'
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.0'
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.0'
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.0'
73
+ version: '7.2'
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: bundler
76
76
  requirement: !ruby/object:Gem::Requirement
@@ -190,6 +190,8 @@ files:
190
190
  - gemfiles/rails_5_1.gemfile
191
191
  - gemfiles/rails_5_2.gemfile
192
192
  - gemfiles/rails_6_0.gemfile
193
+ - gemfiles/rails_6_1.gemfile
194
+ - gemfiles/rails_7_0.gemfile
193
195
  - gemfiles/rails_head.gemfile
194
196
  - lib/active_attr.rb
195
197
  - lib/active_attr/attribute_defaults.rb
@@ -283,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
285
  - !ruby/object:Gem::Version
284
286
  version: '0'
285
287
  requirements: []
286
- rubygems_version: 3.1.2
288
+ rubygems_version: 3.4.1
287
289
  signing_key:
288
290
  specification_version: 4
289
291
  summary: What ActiveModel left out