tiny_sweeper 1.0.1 → 1.1.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 +5 -5
- data/ChangeLog +8 -0
- data/Gemfile.lock +4 -4
- data/README.md +1 -0
- data/lib/tiny_sweeper/broom_closet.rb +4 -0
- data/lib/tiny_sweeper/version.rb +1 -1
- data/spec/tiny_sweeper/broom_closet_spec.rb +6 -0
- data/spec/tiny_sweeper_spec.rb +8 -1
- data/tiny_sweeper.gemspec +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 599a8b0b38962996eab15aa3315a040ffa0a3c444153541e5b5e542d73a5f497
|
4
|
+
data.tar.gz: f90bec0b3214f1591434b377dc0dc5aa8883dcb9074a348a873cba23af87fe3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc866c38d0e0432ea00dc31d14ca316e3d19c83b81f92d5ebb58afba9b7a9d85a44f5716e205f47ee83965ea8aa6b656269be4c61555ec6b453a66458eb4a4f3
|
7
|
+
data.tar.gz: 3fb0dfd7aa4d92517643fc8793911577b80ce3a6fab5a641cef17b45aa12a820bae0aebe7336d3bdeafa79a2f42b3955b66b1d704f7b3da56b4ba45effc672f5
|
data/ChangeLog
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
tiny_sweeper (1.1.1) stable; urgency=low
|
2
|
+
|
3
|
+
* Add `:nbsp` broom for removing non breaking space characters
|
4
|
+
|
5
|
+
tiny_sweeper (1.1.0) stable; urgency=low
|
6
|
+
|
7
|
+
* Change strip to remove UTF-8 NBSP
|
8
|
+
|
1
9
|
tiny_sweeper (1.0.1) stable; urgency=low
|
2
10
|
|
3
11
|
* Fix gemspec warnings:
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tiny_sweeper (
|
4
|
+
tiny_sweeper (1.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -37,9 +37,9 @@ PLATFORMS
|
|
37
37
|
DEPENDENCIES
|
38
38
|
bundler (~> 1.5)
|
39
39
|
codeclimate-test-reporter
|
40
|
-
rake
|
41
|
-
rspec
|
40
|
+
rake (~> 10.0)
|
41
|
+
rspec (~> 3.0)
|
42
42
|
tiny_sweeper!
|
43
43
|
|
44
44
|
BUNDLED WITH
|
45
|
-
1.
|
45
|
+
1.16.1
|
data/README.md
CHANGED
@@ -89,6 +89,7 @@ TinySweeper currently only knows a few tricks...
|
|
89
89
|
* `blanks_to_nil`: turn empty strings into nils
|
90
90
|
* `strip`: just like `String#strip`: removes trailing and leading whitespace
|
91
91
|
* `dumb_quotes`: replace [Smart Quotes](https://en.wikipedia.org/wiki/Quotation_marks_in_English) with their simpler siblings
|
92
|
+
* `nbsp`: replace [non breaking space characters](https://www.w3.org/MarkUp/HTMLPlus/htmlplus_13.html) with an empty string
|
92
93
|
|
93
94
|
...but you can teach it new ones:
|
94
95
|
|
data/lib/tiny_sweeper/version.rb
CHANGED
@@ -22,6 +22,12 @@ RSpec.describe 'the brooms in the BroomCloset' do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
describe 'nbsp' do
|
26
|
+
it 'handles nbsp' do
|
27
|
+
expect(TinySweeper::BroomCloset.nbsp("foo\u00A0bar")).to eq('foobar')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
25
31
|
describe 'dumb_quotes' do
|
26
32
|
it 'replaces smart quotes with dumb quotes in strings' do
|
27
33
|
expect(TinySweeper::BroomCloset.dumb_quotes("abc‘")).to eq(%q{abc'})
|
data/spec/tiny_sweeper_spec.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
RSpec.describe 'cleaning fields' do
|
2
2
|
class Contract
|
3
|
-
attr_accessor :name, :notes
|
3
|
+
attr_accessor :name, :notes, :addendum
|
4
4
|
|
5
5
|
include TinySweeper
|
6
6
|
sweep :notes, &:strip
|
7
7
|
sweep(:name) { |n| n.upcase }
|
8
|
+
sweep :addendum, :nbsp
|
8
9
|
end
|
9
10
|
|
10
11
|
it 'strips notes' do
|
@@ -19,6 +20,12 @@ RSpec.describe 'cleaning fields' do
|
|
19
20
|
expect(contract.name).to eq('GONNA SHOUT IT')
|
20
21
|
end
|
21
22
|
|
23
|
+
it 'removes nbsps from the addendum' do
|
24
|
+
contract = Contract.new
|
25
|
+
contract.addendum = "foo\u00A0bar"
|
26
|
+
expect(contract.addendum).to eq('foobar')
|
27
|
+
end
|
28
|
+
|
22
29
|
it "lets nils through without complaint. nil is YOUR job to handle." do
|
23
30
|
contract = Contract.new
|
24
31
|
expect {
|
data/tiny_sweeper.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_sweeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Bernier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.7.6
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: A tiny helper to clean your inputs
|