Permalink
Browse files

+ Merhaba, Turkey!

  • Loading branch information...
1 parent 4f16f3b commit 394fe10499eafdf14a19f56de262d747b6a0b85c @floere committed Jan 1, 2011
Showing with 7 additions and 2 deletions.
  1. +1 −1 history.textile
  2. +3 −1 lib/phony/countries/all_other.rb
  3. +3 −0 spec/lib/phony_spec.rb
View
2 history.textile
@@ -1,6 +1,6 @@
h2. Version 1.2.1 (forthcoming)
-* hanke: Internal cleanup.
+* hanke: Turkey.
h2. Version 1.2.0
View
4 lib/phony/countries/all_other.rb
@@ -118,7 +118,9 @@ def self.mapping
'84' => fixed(2), # TODO Viet Nam (Socialist Republic of)
'86' => fixed(2), # TODO China (People's Republic of)
- '90' => fixed(2), # TODO Turkey
+ '90' => fixed(3, # Turkey, http://en.wikipedia.org/wiki/Telephone_numbers_in_Turkey
+ :local_format => [3, 4] # Wiki says 7, but the examples say 3, 4.
+ ),
'91' => fixed(2), # TODO India (Republic of)
'92' => fixed(2), # TODO Pakistan (Islamic Republic of), http://en.wikipedia.org/wiki/Telephone_numbers_in_Pakistan, NDC 2-5
'93' => fixed(2, # Afghanistan
View
3 spec/lib/phony_spec.rb
@@ -73,6 +73,9 @@
it "should handle swiss numbers" do
Phony.split('41443643532').should == ['41', '44', '364', '35', '32']
end
+ it 'handles turkish numbers' do
+ Phony.split('903121234567').should == ['90', '312', '123', '4567'] # Ankara
+ end
it "should handle US numbers" do
Phony.split('15551115511').should == ['1', '555', '111', '5511']
end

0 comments on commit 394fe10

Please sign in to comment.