phony 1.7.6 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -117,7 +117,7 @@ Phony.define do
117
117
  one_of(ndcs_with_6_subscriber_digits) >> split(2, 2, 2) |
118
118
  one_of(ndcs_with_7_subscriber_digits) >> split(3, 2, 2) |
119
119
  one_of(%w(800)) >> split(3, 2, 2) | # Russia free number
120
- one_of(%w(840 940)) >> split(2, 2, 2) | # Abhasia
121
120
  one_of(%w(929 995344 9971 99744 9976 997)) >> split(2, 2, 2) | # South Osetia
122
- match(/[67]\d{2}/) >> split(2, 2, 2) # Kazakhstan: (600..799)
121
+ match(/([67]\d{2})/) >> split(2, 2, 2) | # Kazakhstan: (600..799)
122
+ one_of(%w(840 940), :max_length => 3) >> split(2, 2, 2) # Abhasia
123
123
  end
@@ -181,10 +181,11 @@ describe 'country descriptions' do
181
181
  Phony.split('40249123123').should == ['40', '249', '123', '123'] # Olt
182
182
  end
183
183
  it 'handles russian numbers' do
184
- Phony.split('78122345678').should == ['7', '812', '234', '56', '78']
185
- Phony.split('74012771077').should == ['7', '4012', '77', '10', '77']
186
- Phony.split('78402411212').should == ['7', '84024', '1', '12', '12']
187
- Phony.split('7840121212').should == ['7', '840', '12', '12', '12']
184
+ Phony.split('78122345678').should == ['7', '812', '234', '56', '78'] # Russia 3-digit
185
+ Phony.split('74012771077').should == ['7', '4012', '77', '10', '77'] # Russia 4-digit
186
+ Phony.split('78402411212').should == ['7', '84024', '1', '12', '12'] # Russia 5-digit
187
+ Phony.split('7840121212').should == ['7', '840', '12', '12', '12'] # Abhasia
188
+ Phony.split('7209175276').should == ['7', '209', '17', '52', '76'] # Fantasy number
188
189
  end
189
190
  it 'handles south korean numbers' do
190
191
  Phony.split('82212345678').should == ['82', '2', '1234', '5678'] # Seoul
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6
4
+ version: 1.7.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-02 00:00:00.000000000 Z
12
+ date: 2012-07-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Fast international phone number (E164 standard) normalizing, splitting
15
15
  and formatting. Lots of formatting options: International (+.., 00..), national