attribute_normalizer-extras 0.0.1 → 0.0.2
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ddcd0c30e6e3ec3f8401bdb847d9fe39963e3795
|
|
4
|
+
data.tar.gz: 27875feb4d576ef3671aa8f147fdf3409094326b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19c8b88ec229a25a5e4c09daf737556acd661e7d4c5e80ec89edef2169da74da13c283254a828fe3904be0b2409b6ae21ee82ed0fd84fb21c7ab367ebf81fb5b
|
|
7
|
+
data.tar.gz: f3936cf030cdde8160d72f33e8662fd5336b5b867dccea368df93fbacae0a42e3b6a3d1858bdc360d4c477bc19d52e3570d7a6a801042e15d67a974b19de507c
|
|
@@ -2,7 +2,7 @@ module AttributeNormalizer
|
|
|
2
2
|
module Normalizers
|
|
3
3
|
module PostalCodeNormalizer
|
|
4
4
|
def self.normalize(value, options)
|
|
5
|
-
GsubNormalizer.normalize value, pattern: /\W+|_/, replacement: ''
|
|
5
|
+
GsubNormalizer.normalize value.upcase, pattern: /\W+|_/, replacement: ''
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -14,6 +14,11 @@ describe AttributeNormalizer::Normalizers::PostalCodeNormalizer do
|
|
|
14
14
|
it 'removes whitespace' do
|
|
15
15
|
expect(subject.normalize " T1T 1T1 ", {}).to eq "T1T1T1"
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
it 'upcases lowercase text' do
|
|
19
|
+
expect(subject.normalize "t6h1v2", {}).to eq "T6H1V2"
|
|
20
|
+
end
|
|
21
|
+
|
|
17
22
|
end
|
|
18
23
|
|
|
19
24
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: attribute_normalizer-extras
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Darko Dosenovic
|
|
@@ -14,7 +14,7 @@ authors:
|
|
|
14
14
|
autorequire:
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
|
-
date: 2015-
|
|
17
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: bundler
|
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
163
163
|
version: '0'
|
|
164
164
|
requirements: []
|
|
165
165
|
rubyforge_project:
|
|
166
|
-
rubygems_version: 2.0.
|
|
166
|
+
rubygems_version: 2.0.3
|
|
167
167
|
signing_key:
|
|
168
168
|
specification_version: 4
|
|
169
169
|
summary: attribute_normalizer gem extras
|