Skip to content

Commit

Permalink
+ 1.3.4: Slovakia.
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Apr 30, 2011
1 parent e997b04 commit bcee083
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions history.textile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
h2. Version 1.3.4

* hanke: Slovakia.

h2. Version 1.3.3

* hanke: Australia.
Expand Down
3 changes: 2 additions & 1 deletion lib/countries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@
country '389', fixed(2) >> split(3,2,2) # The Former Yugoslav Republic of Macedonia

country '420', fixed(3) >> split(3,3) # Czech Republic
country '421', fixed(2) >> split(3,2,2) # Slovak Republic
country '421', match(/^(9\d\d).+$/) >> split(7) | # Slovak Republic
one_of('2', :max_length => 2) >> split(8) # Bratislava
country '422', fixed(2) >> split(3,2,2) # Spare code
country '423', none >> split(3,2,2) # Liechtenstein (Principality of)
country '424', fixed(2) >> split(3,2,2) # -
Expand Down
2 changes: 1 addition & 1 deletion phony.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'phony'
s.version = '1.3.3'
s.version = '1.3.4'
s.authors = ['Florian Hanke']
s.email = 'florian.hanke+phony@gmail.com'
s.homepage = 'http://github.com/floere/phony'
Expand Down
5 changes: 5 additions & 0 deletions spec/lib/countries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
Phony.split('21611231234').should == ['216', '1', '123', '1234'] # Ariana
Phony.split('21621231234').should == ['216', '2', '123', '1234'] # Bizerte
end
it "handles slovakian numbers" do
Phony.split('421912123456').should == ['421', '912', '123456'] # Mobile
Phony.split('421212345678').should == ['421', '2', '12345678'] # Bratislava
Phony.split('421371234567').should == ['421', '37', '1234567'] # Nitra / Other
end
it "handles swedish numbers" do
Phony.split('46812345678').should == ['46', '8', '12345678'] # Stockholm
Phony.split('46111234567').should == ['46', '11', '1234567']
Expand Down

0 comments on commit bcee083

Please sign in to comment.