has_normalized_attributes 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1fda4bcf138c5f344683454c81f5f487bfce890
4
- data.tar.gz: 0ec6839731b7710722eb7a3bca7417381736bf96
3
+ metadata.gz: 7e37778b8ae93697c06b768b3f52735fe2b64897
4
+ data.tar.gz: 8e03c4140fb42e08d54fc997163b521ec2efbc68
5
5
  SHA512:
6
- metadata.gz: da7e3cc3b96846545ef0d557297187d6ceaa7d78ac79962ee95f6bd20d66d9e6a6067a61ad7a36b4fabc67f3cb41a32545d0a890733d554bad00b8ac87e18712
7
- data.tar.gz: 844bbd5d4aa88e0d8c2bdca18942110be00943143f89b11079f4cd2493d42eb4cafde5c7b9528c9b033397c53b688f83a617306b16a36bbaca3835a6c53549c5
6
+ metadata.gz: e4e44f282445e6d70d068b823fe24428db232622d2df8a3c96546a3e727493e5c39b30ca8225516246d8268f6b48f5635d08b9c9ac8a2ba87cd581186afc7f8b
7
+ data.tar.gz: b20e70e100b07c2b797037dae4d53372f33d3a4e19a126c88d88937bda337f190842733ec5f033568cfebd63c957951b742fa63c502d1836384c1af5f494639c
@@ -21,13 +21,13 @@ module HasNormalizedAttributes
21
21
  }
22
22
 
23
23
  #CONSTANT
24
- ZIPCODE = /[-. )(,]/
25
- PHONE = /[-. )(,]|(^0)/
26
- SSN = /[-. )(,]/
27
- TAXID = /[-. )(,]/
28
- DOLLAR = /[$, ]/
29
- NUMBER = /[, ]/
30
- PERCENT = /[%, ]/
24
+ ZIPCODE = /[-.\s)(,]/
25
+ PHONE = /[-.\s)(,]|(^0)/
26
+ SSN = /[-.\s)(,]/
27
+ TAXID = /[-.\s)(,]/
28
+ DOLLAR = /[$,\s]/
29
+ NUMBER = /[,\s]/
30
+ PERCENT = /[%,\s]/
31
31
  SPACES = /\s/
32
32
 
33
33
  #instance methods
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module HasNormalizedAttributes
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -37,6 +37,7 @@ describe "HasNormalizedAttributes" do
37
37
  it{@resource.phone_attr = "0111-111.1111 "; @resource.phone_attr.should == "1111111111"}
38
38
  it{@resource.phone_attr = "1011-111.1111 "; @resource.phone_attr.should == "10111111111"}
39
39
  it{@resource.phone_attr = "111-0222.333 "; @resource.phone_attr.should == "1110222333"}
40
+ it{@resource.phone_attr = "111-0222.333\t"; @resource.phone_attr.should == "1110222333"}
40
41
  it{@resource.phone_attr = ""; @resource.phone_attr.should == ""}
41
42
  it{@resource.phone_attr = nil; @resource.phone_attr.should == nil}
42
43
  end
@@ -50,6 +51,7 @@ describe "HasNormalizedAttributes" do
50
51
  it{@resource.zipcode_attr = "111111111"; @resource.zipcode_attr.should == "111111111"}
51
52
  it{@resource.zipcode_attr = "(11111) 1111"; @resource.zipcode_attr.should == "111111111"}
52
53
  it{@resource.zipcode_attr = "11111) -1111"; @resource.zipcode_attr.should == "111111111"}
54
+ it{@resource.zipcode_attr = "11111\t-1111"; @resource.zipcode_attr.should == "111111111"}
53
55
  it{@resource.zipcode_attr = "11111.1111"; @resource.zipcode_attr.should == "111111111"}
54
56
  it{@resource.zipcode_attr = "11111 --1111"; @resource.zipcode_attr.should == "111111111"}
55
57
  it{@resource.zipcode_attr = " 11111,1111 "; @resource.zipcode_attr.should == "111111111"}
@@ -67,6 +69,7 @@ describe "HasNormalizedAttributes" do
67
69
  it{@resource.ssn_attr = "(111)111-1111"; @resource.ssn_attr.should == "1111111111"}
68
70
  it{@resource.ssn_attr = "(111)1111111"; @resource.ssn_attr.should == "1111111111"}
69
71
  it{@resource.ssn_attr = " 111-111.1111 "; @resource.ssn_attr.should == "1111111111"}
72
+ it{@resource.ssn_attr = " 111-111.1111\t"; @resource.ssn_attr.should == "1111111111"}
70
73
  it{@resource.ssn_attr = ""; @resource.ssn_attr.should == ""}
71
74
  it{@resource.ssn_attr = nil; @resource.ssn_attr.should == nil}
72
75
  end
@@ -76,6 +79,8 @@ describe "HasNormalizedAttributes" do
76
79
  it{@resource.taxid_attr = "12.345"; @resource.taxid_attr.should == "12345"}
77
80
  it{@resource.taxid_attr = "1-2345"; @resource.taxid_attr.should == "12345"}
78
81
  it{@resource.taxid_attr = "1,2345"; @resource.taxid_attr.should == "12345"}
82
+ it{@resource.taxid_attr = "1,2345 "; @resource.taxid_attr.should == "12345"}
83
+ it{@resource.taxid_attr = "1,2345\t"; @resource.taxid_attr.should == "12345"}
79
84
  it{@resource.taxid_attr = ""; @resource.taxid_attr.should == ""}
80
85
  it{@resource.taxid_attr = nil; @resource.taxid_attr.should == nil}
81
86
  end
@@ -85,6 +90,7 @@ describe "HasNormalizedAttributes" do
85
90
  it{@resource.dollar_attr = "111,111";@resource.dollar_attr.should == "111111"}
86
91
  it{@resource.dollar_attr = "111 111 ";@resource.dollar_attr.should == "111111"}
87
92
  it{@resource.dollar_attr = "$111, 111 ";@resource.dollar_attr.should == "111111"}
93
+ it{@resource.dollar_attr = "$111\t111\t";@resource.dollar_attr.should == "111111"}
88
94
  it{@resource.dollar_attr = "";@resource.dollar_attr.should == ""}
89
95
  it{@resource.dollar_attr = nil;@resource.dollar_attr.should == nil}
90
96
  it{@resource.dollar_attr = 111111.51;@resource.dollar_attr.should == "111111.51"}
@@ -96,6 +102,7 @@ describe "HasNormalizedAttributes" do
96
102
  describe "#number" do
97
103
  it{@resource.number_attr = "1,23";@resource.number_attr.should == "123"}
98
104
  it{@resource.number_attr = "1 23 ";@resource.number_attr.should == "123"}
105
+ it{@resource.number_attr = "1\t23\t";@resource.number_attr.should == "123"}
99
106
  it{@resource.number_attr = "";@resource.number_attr.should == ""}
100
107
  it{@resource.number_attr = nil;@resource.number_attr.should == nil}
101
108
  it{@resource.dollar_attr = 111111.51;@resource.dollar_attr.should == "111111.51"}
@@ -108,12 +115,14 @@ describe "HasNormalizedAttributes" do
108
115
  it{@resource.percent_attr = "11%";@resource.percent_attr.should == "11"}
109
116
  it{@resource.percent_attr = "%11";@resource.percent_attr.should == "11"}
110
117
  it{@resource.percent_attr = "1 1 % ";@resource.percent_attr.should == "11"}
118
+ it{@resource.percent_attr = "1\t1\t%\t";@resource.percent_attr.should == "11"}
111
119
  it{@resource.percent_attr = "";@resource.percent_attr.should == ""}
112
120
  it{@resource.percent_attr = nil;@resource.percent_attr.should == nil}
113
121
  end
114
122
 
115
123
  describe "#spaces" do
116
124
  it{@resource.spaces_attr = "5 0";@resource.spaces_attr.should == "50"}
125
+ it{@resource.spaces_attr = "5\t0";@resource.spaces_attr.should == "50"}
117
126
  it{@resource.spaces_attr = "";@resource.spaces_attr.should == ""}
118
127
  it{@resource.spaces_attr = nil;@resource.spaces_attr.should == nil}
119
128
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_normalized_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Ginavan