strip_attributes 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/strip_attributes/version.rb +1 -1
- data/lib/strip_attributes.rb +6 -9
- metadata +8 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d901257abbca144b30becb86cd248e512f8f8b140a6f822d3965f1896356d7c
|
4
|
+
data.tar.gz: 798c083261f25f554767c216cfb399961e48e723a5d06355a12f82cb591eed45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01a7956efa14fa00820e59171bbc1324d015a457db4224f1d5903d1c9ecce31b39d2cc9fb34c26a7e9ae2dcf868fc49034682d5d2f6a0bb532ab89c16898a938
|
7
|
+
data.tar.gz: 41ac5050c3810cd7de390efff4564a6cec3b025fc90455ce3b6c084444821a3deeb4873155b4ee00cc86f9dfaa426a31f88d1aeaca8195ee0965c606ea56d04b
|
data/lib/strip_attributes.rb
CHANGED
@@ -83,11 +83,11 @@ module StripAttributes
|
|
83
83
|
# Necessary because Rails has removed the narrowing of attributes using :only
|
84
84
|
# and :except on Base#attributes
|
85
85
|
def self.narrow(attributes, options = {})
|
86
|
-
if
|
87
|
-
except = Array(except).
|
86
|
+
if options[:except]
|
87
|
+
except = Array(options[:except]).map(&:to_s)
|
88
88
|
attributes.except(*except)
|
89
|
-
elsif
|
90
|
-
only = Array(only).
|
89
|
+
elsif options[:only]
|
90
|
+
only = Array(options[:only]).map(&:to_s)
|
91
91
|
attributes.slice(*only)
|
92
92
|
else
|
93
93
|
attributes
|
@@ -95,10 +95,7 @@ module StripAttributes
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def self.validate_options(options)
|
98
|
-
if keys
|
99
|
-
|
100
|
-
raise ArgumentError, "Options does not specify #{VALID_OPTIONS} (#{options.keys.inspect})"
|
101
|
-
end
|
102
|
-
end
|
98
|
+
return if (options.keys - VALID_OPTIONS).empty?
|
99
|
+
raise ArgumentError, "Options does not specify #{VALID_OPTIONS} (#{options.keys.inspect})"
|
103
100
|
end
|
104
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strip_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan McGeary
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '3.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '9.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '3.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '9.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: active_attr
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -48,22 +48,16 @@ dependencies:
|
|
48
48
|
name: minitest
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '5.0'
|
54
|
-
- - "<"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '6.0'
|
57
54
|
type: :development
|
58
55
|
prerelease: false
|
59
56
|
version_requirements: !ruby/object:Gem::Requirement
|
60
57
|
requirements:
|
61
|
-
- - "
|
58
|
+
- - "~>"
|
62
59
|
- !ruby/object:Gem::Version
|
63
60
|
version: '5.0'
|
64
|
-
- - "<"
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: '6.0'
|
67
61
|
- !ruby/object:Gem::Dependency
|
68
62
|
name: minitest-matchers_vaccine
|
69
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,6 +127,7 @@ metadata:
|
|
133
127
|
bug_tracker_uri: https://github.com/rmm5t/strip_attributes/issues
|
134
128
|
changelog_uri: https://github.com/rmm5t/strip_attributes/blob/master/CHANGELOG.md
|
135
129
|
source_code_uri: https://github.com/rmm5t/strip_attributes
|
130
|
+
funding_uri: https://github.com/sponsors/rmm5t
|
136
131
|
post_install_message:
|
137
132
|
rdoc_options: []
|
138
133
|
require_paths:
|
@@ -148,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
143
|
- !ruby/object:Gem::Version
|
149
144
|
version: '0'
|
150
145
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
146
|
+
rubygems_version: 3.5.23
|
152
147
|
signing_key:
|
153
148
|
specification_version: 4
|
154
149
|
summary: Whitespace cleanup for ActiveModel attributes
|