strip_attributes 1.7.1 → 1.8.0
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/LICENSE.txt +22 -0
- data/README.md +63 -15
- data/Rakefile +11 -0
- data/lib/strip_attributes.rb +26 -21
- data/lib/strip_attributes/version.rb +1 -1
- data/test/matchers_test.rb +35 -9
- data/test/strip_attributes_test.rb +17 -11
- metadata +29 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5061515aff0590e41f315a088c1248a4173afd68
|
4
|
+
data.tar.gz: e5482a0d08c97c52c80de77b4e4ccbfcb60c515d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d57177c65fcfe6c9788fcf146de1455c1cb56c0dfa37469028abe123ee4713278ebd0be4b0b1a2dae954c34cf9e6c441f11ea14e1f7b2355d21c5f56c4e3a440
|
7
|
+
data.tar.gz: de6f761513b48057ddc748db448e6d443fa06b9e20b7bff8788a57ddd2a9e7d16810b96571e14df9f69e5615970ba4ec02bfacbef07ec5b9a4313805f83d4d9a
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012-2015 Ryan McGeary
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
# StripAttributes
|
1
|
+
# StripAttributes
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/strip_attributes)
|
4
|
+
[](http://travis-ci.org/rmm5t/strip_attributes)
|
5
|
+
[](https://codeclimate.com/github/rmm5t/strip_attributes)
|
6
|
+
[](https://rubygems.org/gems/strip_attributes)
|
2
7
|
|
3
8
|
StripAttributes is an ActiveModel extension that automatically strips all
|
4
9
|
attributes of leading and trailing whitespace before validation. If the
|
@@ -15,18 +20,19 @@ a single attribute (`:only => :field`) or arrays of attributes (`:except =>
|
|
15
20
|
**How You Can Help**
|
16
21
|
|
17
22
|
[][square]
|
18
|
-
[][paypal]
|
19
24
|
[][codementor]
|
20
25
|
|
21
|
-
If you like this project, [buy me a coffee][
|
22
|
-
|
23
|
-
Bitcoin: `1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m`
|
26
|
+
If you like this project, [buy me a coffee][paypal], or [book a session with me][codementor], or donate bitcoin: `1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m`
|
24
27
|
|
25
|
-
[square]: https://cash.me/$rmm5t "Donate to rmm5t for open source!"
|
26
|
-
[
|
28
|
+
[square]: https://cash.me/$rmm5t/5 "Donate to rmm5t for open source!"
|
29
|
+
[paypal]: https://www.paypal.me/rmm5t/5 "Donate to rmm5t for open source!"
|
27
30
|
[bitcoin]: bitcoin:1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m?amount=0.01&label=Coffee%20to%20rmm5t%20for%20Open%20Source "Buy rmm5t a coffee for open source!"
|
28
31
|
[codementor]: https://www.codementor.io/rmm5t?utm_campaign=profile&utm_source=button-rmm5t&utm_medium=shields "Book a session with rmm5t on Codementor!"
|
29
32
|
|
33
|
+
[](https://twitter.com/rmm5t)
|
34
|
+
[](http://stackoverflow.com/users/8985/ryan-mcgeary)
|
35
|
+
|
30
36
|
## Installation
|
31
37
|
|
32
38
|
Include the gem in your Gemfile:
|
@@ -147,11 +153,13 @@ StripAttributes.strip(" foo bar", :collapse_spaces => true) #=> "foo bar"
|
|
147
153
|
StripAttributes provides an RSpec/Shoulda-compatible matcher for easier
|
148
154
|
testing of attribute assignment. You can use this with
|
149
155
|
[RSpec](http://rspec.info/), [Shoulda](https://github.com/thoughtbot/shoulda),
|
150
|
-
|
156
|
+
[Minitest-MatchersVaccine](https://github.com/rmm5t/minitest-matchers_vaccine)
|
157
|
+
(preferred), or
|
158
|
+
[Minitest-Matchers](https://github.com/wojtekmach/minitest-matchers).
|
151
159
|
|
152
160
|
### Setup `spec_helper.rb` or `test_helper.rb`
|
153
161
|
|
154
|
-
To initialize **RSpec**, add this to your `spec_helper.rb`:
|
162
|
+
#### To initialize **RSpec**, add this to your `spec_helper.rb`:
|
155
163
|
|
156
164
|
```ruby
|
157
165
|
require "strip_attributes/matchers"
|
@@ -160,7 +168,7 @@ RSpec.configure do |config|
|
|
160
168
|
end
|
161
169
|
```
|
162
170
|
|
163
|
-
To initialize **Shoulda (with test-unit)**, add this to your `test_helper.rb`:
|
171
|
+
#### To initialize **Shoulda (with test-unit)**, add this to your `test_helper.rb`:
|
164
172
|
|
165
173
|
```ruby
|
166
174
|
require "strip_attributes/matchers"
|
@@ -169,7 +177,34 @@ class Test::Unit::TestCase
|
|
169
177
|
end
|
170
178
|
```
|
171
179
|
|
172
|
-
|
180
|
+
OR if in a Rails environment, you might prefer this:
|
181
|
+
|
182
|
+
``` ruby
|
183
|
+
require "strip_attributes/matchers"
|
184
|
+
class ActiveSupport::TestCase
|
185
|
+
extend StripAttributes::Matchers
|
186
|
+
end
|
187
|
+
```
|
188
|
+
|
189
|
+
#### To initialize **Minitest-MatchersVaccine**, add this to your `test_helper.rb`:
|
190
|
+
|
191
|
+
```ruby
|
192
|
+
require "strip_attributes/matchers_vaccine"
|
193
|
+
class MiniTest::Spec
|
194
|
+
include StripAttributes::Matchers
|
195
|
+
end
|
196
|
+
```
|
197
|
+
|
198
|
+
OR if in a Rails environment, you might prefer this:
|
199
|
+
|
200
|
+
``` ruby
|
201
|
+
require "strip_attributes/matchers_vaccine"
|
202
|
+
class ActiveSupport::TestCase
|
203
|
+
include StripAttributes::Matchers
|
204
|
+
end
|
205
|
+
```
|
206
|
+
|
207
|
+
#### To initialize **Minitest-Matchers**, add this to your `test_helper.rb`:
|
173
208
|
|
174
209
|
```ruby
|
175
210
|
require "strip_attributes/matchers"
|
@@ -200,6 +235,20 @@ class UserTest < ActiveSupport::TestCase
|
|
200
235
|
end
|
201
236
|
```
|
202
237
|
|
238
|
+
**Minitest-MatchersVaccine**:
|
239
|
+
|
240
|
+
```ruby
|
241
|
+
describe User do
|
242
|
+
subject { User.new }
|
243
|
+
|
244
|
+
it "should strip attributes" do
|
245
|
+
must strip_attribute(:name).collapse_spaces
|
246
|
+
must strip_attribute :email
|
247
|
+
wont strip_attribute :password
|
248
|
+
end
|
249
|
+
end
|
250
|
+
```
|
251
|
+
|
203
252
|
**Minitest-Matchers**:
|
204
253
|
|
205
254
|
```ruby
|
@@ -221,10 +270,9 @@ form of new unit tests.
|
|
221
270
|
|
222
271
|
## Credits
|
223
272
|
|
224
|
-
The idea was originally triggered by the information at the (now defunct)
|
225
|
-
Wiki
|
226
|
-
|
227
|
-
support.
|
273
|
+
The idea was originally triggered by the information at the (now defunct)
|
274
|
+
Rails Wiki but was modified from the original to include more idiomatic ruby
|
275
|
+
and rails support.
|
228
276
|
|
229
277
|
## Versioning
|
230
278
|
|
data/Rakefile
ADDED
data/lib/strip_attributes.rb
CHANGED
@@ -20,7 +20,22 @@ end
|
|
20
20
|
|
21
21
|
module StripAttributes
|
22
22
|
VALID_OPTIONS = [:only, :except, :allow_empty, :collapse_spaces, :replace_newlines, :regex]
|
23
|
-
|
23
|
+
|
24
|
+
# Unicode invisible and whitespace characters. The POSIX character class
|
25
|
+
# [:space:] corresponds to the Unicode class Z ("separator"). We also
|
26
|
+
# include the following characters from Unicode class C ("control"), which
|
27
|
+
# are spaces or invisible characters that make no sense at the start or end
|
28
|
+
# of a string:
|
29
|
+
# U+180E MONGOLIAN VOWEL SEPARATOR
|
30
|
+
# U+200B ZERO WIDTH SPACE
|
31
|
+
# U+200C ZERO WIDTH NON-JOINER
|
32
|
+
# U+200D ZERO WIDTH JOINER
|
33
|
+
# U+2060 WORD JOINER
|
34
|
+
# U+FEFF ZERO WIDTH NO-BREAK SPACE
|
35
|
+
MULTIBYTE_WHITE = "\u180E\u200B\u200C\u200D\u2060\uFEFF"
|
36
|
+
MULTIBYTE_SPACE = /[[:space:]#{MULTIBYTE_WHITE}]/
|
37
|
+
MULTIBYTE_BLANK = /[[:blank:]#{MULTIBYTE_WHITE}]/
|
38
|
+
MULTIBYTE_SUPPORTED = "\u0020" == " "
|
24
39
|
|
25
40
|
def self.strip(record_or_string, options = nil)
|
26
41
|
if record_or_string.respond_to?(:attributes)
|
@@ -55,35 +70,25 @@ module StripAttributes
|
|
55
70
|
end
|
56
71
|
|
57
72
|
if regex && value.respond_to?(:gsub!)
|
58
|
-
value.gsub!(regex,
|
73
|
+
value.gsub!(regex, "")
|
59
74
|
end
|
60
75
|
|
61
|
-
if MULTIBYTE_SUPPORTED
|
62
|
-
#
|
63
|
-
# The POSIX character class [:space:] corresponds to the Unicode class Z
|
64
|
-
# ("separator"). We also include the following characters from Unicode class
|
65
|
-
# C ("control"), which are spaces or invisible characters that make no
|
66
|
-
# sense at the start or end of a string:
|
67
|
-
# U+180E MONGOLIAN VOWEL SEPARATOR
|
68
|
-
# U+200B ZERO WIDTH SPACE
|
69
|
-
# U+200C ZERO WIDTH NON-JOINER
|
70
|
-
# U+200D ZERO WIDTH JOINER
|
71
|
-
# U+2060 WORD JOINER
|
72
|
-
# U+FEFF ZERO WIDTH NO-BREAK SPACE
|
73
|
-
regex = /\A[[:space:]\u180E\u200B\u200C\u200D\u2060\uFEFF]+|[[:space:]\u180E\u200B\u200C\u200D\u2060\uFEFF]+\z/
|
74
|
-
if value.respond_to?(:gsub!) && Encoding.compatible?(value, regex)
|
75
|
-
value.gsub!(regex, '')
|
76
|
-
end
|
76
|
+
if MULTIBYTE_SUPPORTED && value.respond_to?(:gsub!) && Encoding.compatible?(value, MULTIBYTE_SPACE)
|
77
|
+
value.gsub!(/\A#{MULTIBYTE_SPACE}+|#{MULTIBYTE_SPACE}+\z/, "")
|
77
78
|
elsif value.respond_to?(:strip!)
|
78
79
|
value.strip!
|
79
80
|
end
|
80
81
|
|
81
82
|
if replace_newlines && value.respond_to?(:gsub!)
|
82
|
-
value.gsub!(/[\r\n]+/,
|
83
|
+
value.gsub!(/[\r\n]+/, " ")
|
83
84
|
end
|
84
85
|
|
85
|
-
if collapse_spaces
|
86
|
-
value.
|
86
|
+
if collapse_spaces
|
87
|
+
if MULTIBYTE_SUPPORTED && value.respond_to?(:gsub!) && Encoding.compatible?(value, MULTIBYTE_BLANK)
|
88
|
+
value.gsub!(/#{MULTIBYTE_BLANK}+/, " ")
|
89
|
+
elsif value.respond_to?(:squeeze!)
|
90
|
+
value.squeeze!(" ")
|
91
|
+
end
|
87
92
|
end
|
88
93
|
|
89
94
|
value
|
data/test/matchers_test.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require "minitest/matchers_vaccine"
|
3
|
+
rescue LoadError
|
4
|
+
require "minitest/matchers"
|
5
|
+
end
|
2
6
|
require "test_helper"
|
3
7
|
require "strip_attributes/matchers"
|
4
8
|
|
@@ -21,15 +25,37 @@ describe SampleMockRecord do
|
|
21
25
|
|
22
26
|
subject { SampleMockRecord.new }
|
23
27
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
if defined? Minitest::MatchersVaccine
|
29
|
+
it "should strip strippable attributes" do
|
30
|
+
must strip_attribute :stripped1
|
31
|
+
must strip_attribute :stripped2
|
32
|
+
must strip_attribute :stripped3
|
33
|
+
end
|
30
34
|
|
31
|
-
|
32
|
-
|
35
|
+
it "should not strip other attributes" do
|
36
|
+
wont strip_attribute :unstripped1
|
37
|
+
wont strip_attribute :unstripped2
|
38
|
+
wont strip_attribute :unstripped3
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should collapse collapsible attributes" do
|
42
|
+
must strip_attribute(:collapsed).collapse_spaces
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should not collapse other attributes" do
|
46
|
+
wont strip_attribute(:uncollapsed).collapse_spaces
|
47
|
+
end
|
48
|
+
else
|
49
|
+
must { strip_attribute :stripped1 }
|
50
|
+
must { strip_attribute :stripped2 }
|
51
|
+
must { strip_attribute :stripped3 }
|
52
|
+
wont { strip_attribute :unstripped1 }
|
53
|
+
wont { strip_attribute :unstripped2 }
|
54
|
+
wont { strip_attribute :unstripped3 }
|
55
|
+
|
56
|
+
must { strip_attribute(:collapsed).collapse_spaces }
|
57
|
+
wont { strip_attribute(:uncollapsed).collapse_spaces }
|
58
|
+
end
|
33
59
|
|
34
60
|
it "should fail when testing for strip on an unstripped attribute" do
|
35
61
|
begin
|
@@ -74,7 +74,15 @@ end
|
|
74
74
|
|
75
75
|
class StripAttributesTest < Minitest::Test
|
76
76
|
def setup
|
77
|
-
@init_params = {
|
77
|
+
@init_params = {
|
78
|
+
:foo => "\tfoo",
|
79
|
+
:bar => "bar \t ",
|
80
|
+
:biz => "\tbiz ",
|
81
|
+
:baz => "",
|
82
|
+
:bang => " ",
|
83
|
+
:foz => " foz foz",
|
84
|
+
:fiz => "fiz \n fiz"
|
85
|
+
}
|
78
86
|
end
|
79
87
|
|
80
88
|
def test_should_exist
|
@@ -227,11 +235,9 @@ class StripAttributesTest < Minitest::Test
|
|
227
235
|
end
|
228
236
|
|
229
237
|
def test_should_strip_unicode
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
# U200B - ZERO WIDTH SPACE
|
234
|
-
record = StripOnlyOneMockRecord.new({:foo => "\u200A\u200B foo\u200A\u200B "})
|
238
|
+
skip "multi-byte characters not supported by this version of Ruby" unless StripAttributes::MULTIBYTE_SUPPORTED
|
239
|
+
|
240
|
+
record = StripOnlyOneMockRecord.new({:foo => "\u200A\u200B foo\u200A\u200B\u00A0 "})
|
235
241
|
record.valid?
|
236
242
|
assert_equal "foo", record.foo
|
237
243
|
end
|
@@ -252,6 +258,10 @@ class StripAttributesTest < Minitest::Test
|
|
252
258
|
assert_equal "1 2 3", StripAttributes.strip(" 1 2 3\t ", :collapse_spaces => true)
|
253
259
|
end
|
254
260
|
|
261
|
+
def test_should_collapse_multibyte_spaces
|
262
|
+
assert_equal "1 2 3", StripAttributes.strip(" 1 \u00A0 2\u00A03\t ", :collapse_spaces => true)
|
263
|
+
end
|
264
|
+
|
255
265
|
def test_should_replace_newlines
|
256
266
|
assert_equal "1 2", StripAttributes.strip("1\n2", :replace_newlines => true)
|
257
267
|
assert_equal "1 2", StripAttributes.strip("1\r\n2", :replace_newlines => true)
|
@@ -263,11 +273,7 @@ class StripAttributesTest < Minitest::Test
|
|
263
273
|
end
|
264
274
|
|
265
275
|
def test_should_strip_unicode
|
266
|
-
|
267
|
-
return if "\u0020" != " "
|
268
|
-
# U200A - HAIR SPACE
|
269
|
-
# U200B - ZERO WIDTH SPACE
|
270
|
-
# U20AC - EURO SIGN
|
276
|
+
skip "multi-byte characters not supported by this version of Ruby" unless StripAttributes::MULTIBYTE_SUPPORTED
|
271
277
|
|
272
278
|
assert_equal "foo", StripAttributes.strip("\u200A\u200B foo\u200A\u200B ")
|
273
279
|
assert_equal "foo\u20AC".force_encoding("ASCII-8BIT"), StripAttributes.strip("foo\u20AC ".force_encoding("ASCII-8BIT"))
|
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.8.0
|
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: 2016-06-02 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: '6.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,42 +29,28 @@ dependencies:
|
|
29
29
|
version: '3.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: active_attr
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
40
|
-
type: :development
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0.7'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: minitest-matchers
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.2'
|
39
|
+
version: '0.9'
|
54
40
|
type: :development
|
55
41
|
prerelease: false
|
56
42
|
version_requirements: !ruby/object:Gem::Requirement
|
57
43
|
requirements:
|
58
44
|
- - "~>"
|
59
45
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
46
|
+
version: '0.9'
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: minitest
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
64
50
|
requirements:
|
65
51
|
- - ">="
|
66
52
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
53
|
+
version: '5.0'
|
68
54
|
- - "<"
|
69
55
|
- !ruby/object:Gem::Version
|
70
56
|
version: '6.0'
|
@@ -74,10 +60,24 @@ dependencies:
|
|
74
60
|
requirements:
|
75
61
|
- - ">="
|
76
62
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
63
|
+
version: '5.0'
|
78
64
|
- - "<"
|
79
65
|
- !ruby/object:Gem::Version
|
80
66
|
version: '6.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: minitest-matchers_vaccine
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '1.0'
|
74
|
+
type: :development
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.0'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: minitest-reporters
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,16 +96,16 @@ dependencies:
|
|
96
96
|
name: rake
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- - "
|
99
|
+
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
101
|
+
version: '0'
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
|
-
- - "
|
106
|
+
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
108
|
+
version: '0'
|
109
109
|
description: StripAttributes automatically strips all ActiveRecord model attributes
|
110
110
|
of leading and trailing whitespace before validation. If the attribute is blank,
|
111
111
|
it strips the value to nil.
|
@@ -115,7 +115,9 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
+
- LICENSE.txt
|
118
119
|
- README.md
|
120
|
+
- Rakefile
|
119
121
|
- lib/strip_attributes.rb
|
120
122
|
- lib/strip_attributes/matchers.rb
|
121
123
|
- lib/strip_attributes/shoulda.rb
|
@@ -144,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
146
|
version: '0'
|
145
147
|
requirements: []
|
146
148
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.5.1
|
148
150
|
signing_key:
|
149
151
|
specification_version: 4
|
150
152
|
summary: Whitespace cleanup for ActiveModel attributes
|