activecleaner 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +6 -4
- data/lib/active_cleaner/version.rb +1 -1
- data/spec/cases/inherit_spec.rb +30 -28
- data/spec/cases/nilify_spec.rb +25 -25
- data/spec/cases/simple_spec.rb +25 -25
- data/spec/lib/active_cleaner/markdown_cleaner_spec.rb +10 -12
- data/spec/lib/active_cleaner/string_cleaner_spec.rb +8 -10
- data/spec/lib/active_cleaner/text_cleaner_spec.rb +10 -12
- metadata +55 -46
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 54ad3d4c2a454cfb2e8237abb6399bab45d5448c
|
4
|
+
data.tar.gz: 3bf151d63ce0286fa4819a2ce1a25e61a62a3047
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 46a2b65f759e7d9501de3795637707e9a5de27375185526e7fc55c6bb9cd270f880b498e0e6817f3ac414d68449407734f5976b9107bbb8727b28585f01c13d8
|
7
|
+
data.tar.gz: 7a7d84b9e7ff1e68733b13e1b4c995f85f07f001a2a77de562c2ef501ae76aae9cdc222c0fc6eeafb2337645c9a76602f353feab9b2955ea4ab319b2ff81cb6e
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# ActiveCleaner
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/activecleaner.svg)](http://badge.fury.io/rb/activecleaner) [![Build Status](https://travis-ci.org/maximeg/activecleaner.svg?branch=master)](https://travis-ci.org/maximeg/activecleaner)
|
4
|
+
|
3
5
|
`ActiveCleaner` is a set of helpers that helps you in cleaning user-typed content in your ActiveModel depending models (ActiveRecord, Mongoid...)
|
4
6
|
|
5
7
|
Extra spaces mean extra storage. And it could ruin your indexes and your sortings.
|
@@ -22,8 +24,8 @@ end
|
|
22
24
|
### Cleaners included
|
23
25
|
|
24
26
|
* `:string` (StringCleaner, the default one) : cleans all the space characters. It turns `" A \n \t title \t "` into `"A title"`.
|
25
|
-
* `:text` (TextCleaner) : like `:string`, but preserves new lines (with a max of 2 successive new lines).
|
26
|
-
* `:markdown` (MarkdownCleaner) : like `:text`, but preserves spaces in the
|
27
|
+
* `:text` (TextCleaner) : like `:string`, but preserves new lines (with a max of 2 successive new lines). useful when the field is rendered with the `simple_format` Rails helper.
|
28
|
+
* `:markdown` (MarkdownCleaner) : like `:text`, but preserves spaces in the beginning of lines (the indentation). useful for... markdown!
|
27
29
|
|
28
30
|
|
29
31
|
|
@@ -91,6 +93,6 @@ You can also use `guard` to run the specs during dev.
|
|
91
93
|
* Maxime Garcia [emaxime.com](http://emaxime.com) [@maximegarcia](http://twitter.com/maximegarcia)
|
92
94
|
|
93
95
|
|
94
|
-
[License](https://github.com/maximeg/activecleaner/blob/master/
|
96
|
+
[License](https://github.com/maximeg/activecleaner/blob/master/LICENSE)
|
95
97
|
\- [Report a bug](https://github.com/maximeg/activecleaner/issues)
|
96
|
-
[
|
98
|
+
\- [Rubygems page](https://rubygems.org/gems/activecleaner)
|
data/spec/cases/inherit_spec.rb
CHANGED
@@ -31,14 +31,16 @@ describe "Case: an ad and his inherited car ad" do
|
|
31
31
|
|
32
32
|
subject { Ad._cleaners }
|
33
33
|
|
34
|
-
it
|
34
|
+
it "has 2 cleaners" do
|
35
|
+
expect(subject.length).to eq(2)
|
36
|
+
end
|
35
37
|
|
36
38
|
it "includes a StringCleaner for #title" do
|
37
|
-
subject[:title].first.
|
39
|
+
expect(subject[:title].first).to eq(ActiveCleaner::StringCleaner.new(:title))
|
38
40
|
end
|
39
41
|
|
40
42
|
it "includes a StringCleaner for #name" do
|
41
|
-
subject[:name].first.
|
43
|
+
expect(subject[:name].first).to eq(ActiveCleaner::StringCleaner.new(:name))
|
42
44
|
end
|
43
45
|
|
44
46
|
end # describe
|
@@ -47,40 +49,40 @@ describe "Case: an ad and his inherited car ad" do
|
|
47
49
|
|
48
50
|
subject { CarAd._cleaners }
|
49
51
|
|
50
|
-
it
|
52
|
+
it "has 3 cleaners" do
|
53
|
+
expect(subject.length).to eq(3)
|
54
|
+
end
|
51
55
|
|
52
56
|
it "includes a StringCleaner for #title" do
|
53
|
-
subject[:title].first.
|
57
|
+
expect(subject[:title].first).to eq(ActiveCleaner::StringCleaner.new(:title))
|
54
58
|
end
|
55
59
|
|
56
60
|
it "includes a StringCleaner for #name" do
|
57
|
-
subject[:name].first.
|
61
|
+
expect(subject[:name].first).to eq(ActiveCleaner::StringCleaner.new(:name))
|
58
62
|
end
|
59
63
|
|
60
64
|
it "includes a TextCleaner for #body" do
|
61
|
-
subject[:body].first.
|
65
|
+
expect(subject[:body].first).to eq(ActiveCleaner::TextCleaner.new(:body))
|
62
66
|
end
|
63
67
|
|
64
68
|
end # describe
|
65
69
|
|
66
70
|
context "considering a car ad" do
|
67
71
|
|
68
|
-
|
69
|
-
@car_ad = CarAd.new
|
70
|
-
end
|
72
|
+
let(:subject) { CarAd.new }
|
71
73
|
|
72
74
|
describe "#title, marked as to clean with no type" do
|
73
75
|
|
74
76
|
it "is untouched when legit" do
|
75
|
-
|
76
|
-
|
77
|
-
|
77
|
+
subject.title = "A good title!"
|
78
|
+
subject.valid?
|
79
|
+
expect(subject.title).to eq("A good title!")
|
78
80
|
end
|
79
81
|
|
80
82
|
it "is cleaned as a string" do
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
subject.title = " A \n good \t title! "
|
84
|
+
subject.valid?
|
85
|
+
expect(subject.title).to eq("A good title!")
|
84
86
|
end
|
85
87
|
|
86
88
|
end # describe
|
@@ -88,15 +90,15 @@ describe "Case: an ad and his inherited car ad" do
|
|
88
90
|
describe "#name, marked as to clean as a string" do
|
89
91
|
|
90
92
|
it "is untouched when legit" do
|
91
|
-
|
92
|
-
|
93
|
-
|
93
|
+
subject.name = "John Doe"
|
94
|
+
subject.valid?
|
95
|
+
expect(subject.name).to eq("John Doe")
|
94
96
|
end
|
95
97
|
|
96
98
|
it "is cleaned as a string" do
|
97
|
-
|
98
|
-
|
99
|
-
|
99
|
+
subject.name = " \t John \n Doe "
|
100
|
+
subject.valid?
|
101
|
+
expect(subject.name).to eq("John Doe")
|
100
102
|
end
|
101
103
|
|
102
104
|
end # describe
|
@@ -104,15 +106,15 @@ describe "Case: an ad and his inherited car ad" do
|
|
104
106
|
describe "#body, marked as to clean as a text" do
|
105
107
|
|
106
108
|
it "is untouched when legit" do
|
107
|
-
|
108
|
-
|
109
|
-
|
109
|
+
subject.body = "Lorem ipsum\ndolor sit amet.\n\nLorem."
|
110
|
+
subject.valid?
|
111
|
+
expect(subject.body).to eq("Lorem ipsum\ndolor sit amet.\n\nLorem.")
|
110
112
|
end
|
111
113
|
|
112
114
|
it "is cleaned as a text" do
|
113
|
-
|
114
|
-
|
115
|
-
|
115
|
+
subject.body = "Lorem \t ipsum \t \n dolor \t sit \t amet.\n\n\nLorem."
|
116
|
+
subject.valid?
|
117
|
+
expect(subject.body).to eq("Lorem ipsum\ndolor sit amet.\n\nLorem.")
|
116
118
|
end
|
117
119
|
|
118
120
|
end # describe
|
data/spec/cases/nilify_spec.rb
CHANGED
@@ -26,40 +26,40 @@ describe "Case: a simple post with nulify" do
|
|
26
26
|
|
27
27
|
subject { OptimizedPost._cleaners }
|
28
28
|
|
29
|
-
it
|
29
|
+
it "has 3 cleaners" do
|
30
|
+
expect(subject.length).to eq(3)
|
31
|
+
end
|
30
32
|
|
31
33
|
it "includes a StringCleaner for #title" do
|
32
|
-
subject[:title].first.
|
34
|
+
expect(subject[:title].first).to eq(ActiveCleaner::StringCleaner.new(:title, nilify: true))
|
33
35
|
end
|
34
36
|
|
35
37
|
it "includes a StringCleaner for #name" do
|
36
|
-
subject[:name].first.
|
38
|
+
expect(subject[:name].first).to eq(ActiveCleaner::StringCleaner.new(:name, nilify: true))
|
37
39
|
end
|
38
40
|
|
39
41
|
it "includes a TextCleaner for #body" do
|
40
|
-
subject[:body].first.
|
42
|
+
expect(subject[:body].first).to eq(ActiveCleaner::TextCleaner.new(:body, nilify: true))
|
41
43
|
end
|
42
44
|
|
43
45
|
end # describe
|
44
46
|
|
45
47
|
context "considering a post" do
|
46
48
|
|
47
|
-
|
48
|
-
@post = OptimizedPost.new
|
49
|
-
end
|
49
|
+
let(:subject) { OptimizedPost.new }
|
50
50
|
|
51
51
|
describe "#title, marked as to clean with no type" do
|
52
52
|
|
53
53
|
it "is untouched when legit" do
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
subject.title = "A good title!"
|
55
|
+
subject.valid?
|
56
|
+
expect(subject.title).to eq("A good title!")
|
57
57
|
end
|
58
58
|
|
59
59
|
it "is nulified" do
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
subject.title = " \n \t "
|
61
|
+
subject.valid?
|
62
|
+
expect(subject.title).to be_nil
|
63
63
|
end
|
64
64
|
|
65
65
|
end # describe
|
@@ -67,15 +67,15 @@ describe "Case: a simple post with nulify" do
|
|
67
67
|
describe "#name, marked as to clean as a string" do
|
68
68
|
|
69
69
|
it "is untouched when legit" do
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
subject.name = "John Doe"
|
71
|
+
subject.valid?
|
72
|
+
expect(subject.name).to eq("John Doe")
|
73
73
|
end
|
74
74
|
|
75
75
|
it "is nulified" do
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
subject.title = " \n \t "
|
77
|
+
subject.valid?
|
78
|
+
expect(subject.title).to be_nil
|
79
79
|
end
|
80
80
|
|
81
81
|
end # describe
|
@@ -83,15 +83,15 @@ describe "Case: a simple post with nulify" do
|
|
83
83
|
describe "#body, marked as to clean as a text" do
|
84
84
|
|
85
85
|
it "is untouched when legit" do
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
subject.body = "Lorem ipsum\ndolor sit amet.\n\nLorem."
|
87
|
+
subject.valid?
|
88
|
+
expect(subject.body).to eq("Lorem ipsum\ndolor sit amet.\n\nLorem.")
|
89
89
|
end
|
90
90
|
|
91
91
|
it "is nulified" do
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
subject.title = " \n \t "
|
93
|
+
subject.valid?
|
94
|
+
expect(subject.title).to be_nil
|
95
95
|
end
|
96
96
|
|
97
97
|
end # describe
|
data/spec/cases/simple_spec.rb
CHANGED
@@ -26,40 +26,40 @@ describe "Case: a simple post" do
|
|
26
26
|
|
27
27
|
subject { Post._cleaners }
|
28
28
|
|
29
|
-
it
|
29
|
+
it "has 3 cleaners" do
|
30
|
+
expect(subject.length).to eq(3)
|
31
|
+
end
|
30
32
|
|
31
33
|
it "includes a StringCleaner for #title" do
|
32
|
-
subject[:title].first.
|
34
|
+
expect(subject[:title].first).to eq(ActiveCleaner::StringCleaner.new(:title))
|
33
35
|
end
|
34
36
|
|
35
37
|
it "includes a StringCleaner for #name" do
|
36
|
-
subject[:name].first.
|
38
|
+
expect(subject[:name].first).to eq(ActiveCleaner::StringCleaner.new(:name))
|
37
39
|
end
|
38
40
|
|
39
41
|
it "includes a TextCleaner for #body" do
|
40
|
-
subject[:body].first.
|
42
|
+
expect(subject[:body].first).to eq(ActiveCleaner::TextCleaner.new(:body))
|
41
43
|
end
|
42
44
|
|
43
45
|
end # describe
|
44
46
|
|
45
47
|
context "considering a post" do
|
46
48
|
|
47
|
-
|
48
|
-
@post = Post.new
|
49
|
-
end
|
49
|
+
let(:subject) { Post.new }
|
50
50
|
|
51
51
|
describe "#title, marked as to clean with no type" do
|
52
52
|
|
53
53
|
it "is untouched when legit" do
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
subject.title = "A good title!"
|
55
|
+
subject.valid?
|
56
|
+
expect(subject.title).to eq("A good title!")
|
57
57
|
end
|
58
58
|
|
59
59
|
it "is cleaned as a string" do
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
subject.title = " A \n good \t title! "
|
61
|
+
subject.valid?
|
62
|
+
expect(subject.title).to eq("A good title!")
|
63
63
|
end
|
64
64
|
|
65
65
|
end # describe
|
@@ -67,15 +67,15 @@ describe "Case: a simple post" do
|
|
67
67
|
describe "#name, marked as to clean as a string" do
|
68
68
|
|
69
69
|
it "is untouched when legit" do
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
subject.name = "John Doe"
|
71
|
+
subject.valid?
|
72
|
+
expect(subject.name).to eq("John Doe")
|
73
73
|
end
|
74
74
|
|
75
75
|
it "is cleaned as a string" do
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
subject.name = " \t John \n Doe "
|
77
|
+
subject.valid?
|
78
|
+
expect(subject.name).to eq("John Doe")
|
79
79
|
end
|
80
80
|
|
81
81
|
end # describe
|
@@ -83,15 +83,15 @@ describe "Case: a simple post" do
|
|
83
83
|
describe "#body, marked as to clean as a text" do
|
84
84
|
|
85
85
|
it "is untouched when legit" do
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
subject.body = "Lorem ipsum\ndolor sit amet.\n\nLorem."
|
87
|
+
subject.valid?
|
88
|
+
expect(subject.body).to eq("Lorem ipsum\ndolor sit amet.\n\nLorem.")
|
89
89
|
end
|
90
90
|
|
91
91
|
it "is cleaned as a text" do
|
92
|
-
|
93
|
-
|
94
|
-
|
92
|
+
subject.body = "Lorem \t ipsum \t \n dolor \t sit \t amet.\n\n\nLorem."
|
93
|
+
subject.valid?
|
94
|
+
expect(subject.body).to eq("Lorem ipsum\ndolor sit amet.\n\nLorem.")
|
95
95
|
end
|
96
96
|
|
97
97
|
end # describe
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe ActiveCleaner::MarkdownCleaner do
|
5
5
|
|
6
|
-
|
7
|
-
@cleaner = ActiveCleaner::MarkdownCleaner.new(:body)
|
8
|
-
end
|
6
|
+
let(:cleaner) { ActiveCleaner::MarkdownCleaner.new(:body) }
|
9
7
|
|
10
8
|
describe "#clean_value" do
|
11
9
|
|
@@ -27,7 +25,7 @@ describe ActiveCleaner::MarkdownCleaner do
|
|
27
25
|
body << "\n"
|
28
26
|
body << "A third paragraph."
|
29
27
|
|
30
|
-
|
28
|
+
expect(cleaner.clean_value(body)).to eq(body)
|
31
29
|
end
|
32
30
|
|
33
31
|
it "empties string full of spaces" do
|
@@ -38,28 +36,28 @@ describe ActiveCleaner::MarkdownCleaner do
|
|
38
36
|
"\n",
|
39
37
|
" \t\n \t\n \t\n \t\n",
|
40
38
|
].each do |title|
|
41
|
-
|
39
|
+
expect(cleaner.clean_value(title)).to eq("")
|
42
40
|
end
|
43
41
|
end
|
44
42
|
|
45
43
|
it "cleans repeted spaces" do
|
46
|
-
|
47
|
-
|
44
|
+
expect(cleaner.clean_value("Lorem ipsum \ndolor sit amet.")).to eq("Lorem ipsum\ndolor sit amet.")
|
45
|
+
expect(cleaner.clean_value("Lorem \t ipsum \t \ndolor \t sit \t amet.")).to eq("Lorem ipsum\ndolor sit amet.")
|
48
46
|
end
|
49
47
|
|
50
48
|
context "considering the spaces in the beggining of lines" do
|
51
49
|
it "preserves them" do
|
52
|
-
|
50
|
+
expect(cleaner.clean_value("Lorem ipsum\n dolor sit amet.")).to eq("Lorem ipsum\n dolor sit amet.")
|
53
51
|
end
|
54
52
|
it "clears line full of spaces" do
|
55
|
-
|
53
|
+
expect(cleaner.clean_value("Lorem ipsum \n \n dolor sit amet.")).to eq("Lorem ipsum\n\n dolor sit amet.")
|
56
54
|
end
|
57
55
|
end
|
58
56
|
|
59
57
|
it "keeps two max succeeding new line" do
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
expect(cleaner.clean_value("Lorem ipsum\n\n\ndolor sit amet.")).to eq("Lorem ipsum\n\ndolor sit amet.")
|
59
|
+
expect(cleaner.clean_value("Lorem ipsum\n\n\n\ndolor sit amet.")).to eq("Lorem ipsum\n\ndolor sit amet.")
|
60
|
+
expect(cleaner.clean_value("Lorem ipsum\n \n \n \ndolor sit amet.")).to eq("Lorem ipsum\n\ndolor sit amet.")
|
63
61
|
end
|
64
62
|
|
65
63
|
end
|
@@ -3,14 +3,12 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe ActiveCleaner::StringCleaner do
|
5
5
|
|
6
|
-
|
7
|
-
@cleaner = ActiveCleaner::StringCleaner.new(:title)
|
8
|
-
end
|
6
|
+
let(:cleaner) { ActiveCleaner::StringCleaner.new(:title) }
|
9
7
|
|
10
8
|
describe "#clean_value" do
|
11
9
|
|
12
10
|
it "doesn't touch legit value" do
|
13
|
-
|
11
|
+
expect(cleaner.clean_value("A good title!")).to eq("A good title!")
|
14
12
|
end
|
15
13
|
|
16
14
|
it "empties string full of spaces" do
|
@@ -21,23 +19,23 @@ describe ActiveCleaner::StringCleaner do
|
|
21
19
|
"\n",
|
22
20
|
" \t\n \t\n \t\n \t\n",
|
23
21
|
].each do |title|
|
24
|
-
|
22
|
+
expect(cleaner.clean_value(title)).to eq("")
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
28
26
|
it "cleans leading and trailing spaces" do
|
29
|
-
|
27
|
+
expect(cleaner.clean_value(" A good title! ")).to eq("A good title!")
|
30
28
|
end
|
31
29
|
it "cleans leading and trailing tabs" do
|
32
|
-
|
30
|
+
expect(cleaner.clean_value("\tA good title!\t")).to eq("A good title!")
|
33
31
|
end
|
34
32
|
it "cleans leading and trailing lines" do
|
35
|
-
|
33
|
+
expect(cleaner.clean_value("\nA good title!\n")).to eq("A good title!")
|
36
34
|
end
|
37
35
|
|
38
36
|
it "cleans repeted spaces" do
|
39
|
-
|
40
|
-
|
37
|
+
expect(cleaner.clean_value("A good title!")).to eq("A good title!")
|
38
|
+
expect(cleaner.clean_value("A \n good \t title!")).to eq("A good title!")
|
41
39
|
end
|
42
40
|
|
43
41
|
end
|
@@ -3,9 +3,7 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe ActiveCleaner::TextCleaner do
|
5
5
|
|
6
|
-
|
7
|
-
@cleaner = ActiveCleaner::TextCleaner.new(:text)
|
8
|
-
end
|
6
|
+
let(:cleaner) { ActiveCleaner::TextCleaner.new(:text) }
|
9
7
|
|
10
8
|
describe "#clean_value" do
|
11
9
|
|
@@ -15,7 +13,7 @@ describe ActiveCleaner::TextCleaner do
|
|
15
13
|
"Lorem ipsum\ndolor sit amet.",
|
16
14
|
"Lorem ipsum\n\ndolor sit amet.",
|
17
15
|
].each do |text|
|
18
|
-
|
16
|
+
expect(cleaner.clean_value(text)).to eq(text)
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
@@ -27,28 +25,28 @@ describe ActiveCleaner::TextCleaner do
|
|
27
25
|
"\n",
|
28
26
|
" \t\n \t\n \t\n \t\n",
|
29
27
|
].each do |title|
|
30
|
-
|
28
|
+
expect(cleaner.clean_value(title)).to eq("")
|
31
29
|
end
|
32
30
|
end
|
33
31
|
|
34
32
|
it "cleans leading and trailing spaces" do
|
35
|
-
|
33
|
+
expect(cleaner.clean_value(" Lorem ipsum\ndolor sit amet. ")).to eq("Lorem ipsum\ndolor sit amet.")
|
36
34
|
end
|
37
35
|
it "cleans leading and trailing tabs" do
|
38
|
-
|
36
|
+
expect(cleaner.clean_value("\tLorem ipsum\ndolor sit amet.\t")).to eq("Lorem ipsum\ndolor sit amet.")
|
39
37
|
end
|
40
38
|
it "cleans leading and trailing lines" do
|
41
|
-
|
39
|
+
expect(cleaner.clean_value("\nLorem ipsum\ndolor sit amet.\n")).to eq("Lorem ipsum\ndolor sit amet.")
|
42
40
|
end
|
43
41
|
|
44
42
|
it "cleans repeted spaces" do
|
45
|
-
|
46
|
-
|
43
|
+
expect(cleaner.clean_value("Lorem ipsum \n dolor sit amet.")).to eq("Lorem ipsum\ndolor sit amet.")
|
44
|
+
expect(cleaner.clean_value("Lorem \t ipsum \t \n dolor \t sit \t amet.")).to eq("Lorem ipsum\ndolor sit amet.")
|
47
45
|
end
|
48
46
|
|
49
47
|
it "keeps two max succeeding new line" do
|
50
|
-
|
51
|
-
|
48
|
+
expect(cleaner.clean_value("Lorem ipsum\n\n\ndolor sit amet.")).to eq("Lorem ipsum\n\ndolor sit amet.")
|
49
|
+
expect(cleaner.clean_value("Lorem ipsum\n\n\n\ndolor sit amet.")).to eq("Lorem ipsum\n\ndolor sit amet.")
|
52
50
|
end
|
53
51
|
|
54
52
|
end
|
metadata
CHANGED
@@ -1,115 +1,124 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activecleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.1.0
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Maxime Garcia
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: activemodel
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
|
-
none: false
|
17
16
|
requirements:
|
18
|
-
- -
|
17
|
+
- - ">="
|
19
18
|
- !ruby/object:Gem::Version
|
20
19
|
version: '3.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '4.2'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
21
25
|
version_requirements: !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '3.1'
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '4.2'
|
30
33
|
- !ruby/object:Gem::Dependency
|
34
|
+
name: activesupport
|
31
35
|
requirement: !ruby/object:Gem::Requirement
|
32
|
-
none: false
|
33
36
|
requirements:
|
34
|
-
- -
|
37
|
+
- - ">="
|
35
38
|
- !ruby/object:Gem::Version
|
36
39
|
version: '3.1'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '4.2'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
37
45
|
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
46
|
requirements:
|
40
|
-
- -
|
47
|
+
- - ">="
|
41
48
|
- !ruby/object:Gem::Version
|
42
49
|
version: '3.1'
|
43
|
-
|
44
|
-
|
45
|
-
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '4.2'
|
46
53
|
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
47
55
|
requirement: !ruby/object:Gem::Requirement
|
48
|
-
none: false
|
49
56
|
requirements:
|
50
|
-
- -
|
57
|
+
- - "~>"
|
51
58
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0'
|
59
|
+
version: '3.0'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 3.0.0
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
53
65
|
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
66
|
requirements:
|
56
|
-
- -
|
67
|
+
- - "~>"
|
57
68
|
- !ruby/object:Gem::Version
|
58
|
-
version: '0'
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
description:
|
63
|
-
|
64
|
-
|
65
|
-
'
|
69
|
+
version: '3.0'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 3.0.0
|
73
|
+
description: |2
|
74
|
+
ActiveCleaner is a set of helpers that helps you in cleaning user-typed content in your ActiveModel depending models (ActiveRecord, Mongoid...)
|
66
75
|
email:
|
67
76
|
- maxime.garcia@free.fr
|
68
77
|
executables: []
|
69
78
|
extensions: []
|
70
79
|
extra_rdoc_files: []
|
71
80
|
files:
|
72
|
-
- README.md
|
73
81
|
- LICENSE
|
82
|
+
- README.md
|
74
83
|
- lib/active_cleaner.rb
|
75
|
-
- lib/active_cleaner/markdown_cleaner.rb
|
76
|
-
- lib/active_cleaner/version.rb
|
77
84
|
- lib/active_cleaner/base_cleaner.rb
|
78
85
|
- lib/active_cleaner/helper_methods.rb
|
86
|
+
- lib/active_cleaner/markdown_cleaner.rb
|
79
87
|
- lib/active_cleaner/string_cleaner.rb
|
80
88
|
- lib/active_cleaner/text_cleaner.rb
|
89
|
+
- lib/active_cleaner/version.rb
|
81
90
|
- lib/activecleaner.rb
|
91
|
+
- spec/cases/inherit_spec.rb
|
92
|
+
- spec/cases/nilify_spec.rb
|
93
|
+
- spec/cases/simple_spec.rb
|
94
|
+
- spec/lib/active_cleaner/markdown_cleaner_spec.rb
|
82
95
|
- spec/lib/active_cleaner/string_cleaner_spec.rb
|
83
96
|
- spec/lib/active_cleaner/text_cleaner_spec.rb
|
84
|
-
- spec/lib/active_cleaner/markdown_cleaner_spec.rb
|
85
97
|
- spec/lib/active_cleaner_spec.rb
|
86
98
|
- spec/spec_helper.rb
|
87
|
-
- spec/cases/inherit_spec.rb
|
88
|
-
- spec/cases/simple_spec.rb
|
89
|
-
- spec/cases/nilify_spec.rb
|
90
99
|
homepage: http://github.com/maximeg/activecleaner
|
91
|
-
licenses:
|
100
|
+
licenses:
|
101
|
+
- MIT
|
102
|
+
metadata: {}
|
92
103
|
post_install_message:
|
93
104
|
rdoc_options: []
|
94
105
|
require_paths:
|
95
106
|
- lib
|
96
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
108
|
requirements:
|
99
|
-
- -
|
109
|
+
- - ">="
|
100
110
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
111
|
+
version: '1.9'
|
102
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
-
none: false
|
104
113
|
requirements:
|
105
|
-
- -
|
114
|
+
- - ">="
|
106
115
|
- !ruby/object:Gem::Version
|
107
|
-
version:
|
116
|
+
version: 1.3.6
|
108
117
|
requirements: []
|
109
118
|
rubyforge_project:
|
110
|
-
rubygems_version:
|
119
|
+
rubygems_version: 2.4.1
|
111
120
|
signing_key:
|
112
|
-
specification_version:
|
121
|
+
specification_version: 4
|
113
122
|
summary: Clean the fields in your models
|
114
123
|
test_files:
|
115
124
|
- spec/lib/active_cleaner/string_cleaner_spec.rb
|