phony 1.3.3 → 1.3.4
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.
- data/lib/countries.rb +2 -1
- data/spec/lib/countries_spec.rb +5 -0
- metadata +2 -2
data/lib/countries.rb
CHANGED
@@ -223,7 +223,8 @@ Phony.define do
|
|
223
223
|
country '389', fixed(2) >> split(3,2,2) # The Former Yugoslav Republic of Macedonia
|
224
224
|
|
225
225
|
country '420', fixed(3) >> split(3,3) # Czech Republic
|
226
|
-
country '421',
|
226
|
+
country '421', match(/^(9\d\d).+$/) >> split(7) | # Slovak Republic
|
227
|
+
one_of('2', :max_length => 2) >> split(8) # Bratislava
|
227
228
|
country '422', fixed(2) >> split(3,2,2) # Spare code
|
228
229
|
country '423', none >> split(3,2,2) # Liechtenstein (Principality of)
|
229
230
|
country '424', fixed(2) >> split(3,2,2) # -
|
data/spec/lib/countries_spec.rb
CHANGED
@@ -147,6 +147,11 @@ describe 'country descriptions' do
|
|
147
147
|
Phony.split('21611231234').should == ['216', '1', '123', '1234'] # Ariana
|
148
148
|
Phony.split('21621231234').should == ['216', '2', '123', '1234'] # Bizerte
|
149
149
|
end
|
150
|
+
it "handles slovakian numbers" do
|
151
|
+
Phony.split('421912123456').should == ['421', '912', '123456'] # Mobile
|
152
|
+
Phony.split('421212345678').should == ['421', '2', '12345678'] # Bratislava
|
153
|
+
Phony.split('421371234567').should == ['421', '37', '1234567'] # Nitra / Other
|
154
|
+
end
|
150
155
|
it "handles swedish numbers" do
|
151
156
|
Phony.split('46812345678').should == ['46', '8', '12345678'] # Stockholm
|
152
157
|
Phony.split('46111234567').should == ['46', '11', '1234567']
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: phony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.3.
|
5
|
+
version: 1.3.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Florian Hanke
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-30 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|