phony 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -1,6 +1,6 @@
1
1
  h1. Phony
2
2
 
3
- Used in e.g.: "airbnb.com":airbnb.com, "restorm.com":restorm.com
3
+ Used in e.g.: "airbnb.com":http://airbnb.com, "restorm.com":http://restorm.com, "socialcam.com":http://socialcam.com (and many, many others).
4
4
 
5
5
  h2. Description
6
6
 
@@ -130,9 +130,13 @@ Phony.define do
130
130
  match(/^(7|21|22|23|4[1-8]|3[1-3])/) >> split(7) | # Short NDCs
131
131
  fixed(3) >> split(7) # 3-digit NDCs
132
132
 
133
- # TODO Argentine Republic.
133
+ # Argentine Republic.
134
134
  #
135
- country '54', fixed(2) >> split(3,2,2)
135
+ country '54', one_of('11', '911') >> split(4,4) | # Fixed & Mobile
136
+ match(/^(22[0137]|237|26[14]|29[179]|34[1235]|35[138]|38[1578])/) >> split(3,4) | # Fixed
137
+ match(/^(922[0137]|9237|926[14]|929[179]|934[1235]|935[138]|938[1578])/) >> split(3,4) | # Mobile
138
+ match(/^(9\d{4})/) >> split(2,4) | # Mobile
139
+ fixed(4) >> split(2,4) # Fixed
136
140
 
137
141
  # Brazil (Federative Republic of).
138
142
  #
@@ -12,6 +12,14 @@ describe 'country descriptions' do
12
12
  Phony.split('213211231234').should == ['213', '21', '123', '1234'] # Algiers
13
13
  Phony.split('213331231234').should == ['213', '33', '123', '1234'] # Batna
14
14
  end
15
+ it 'handles argentine numbers' do
16
+ Phony.split('541112345678').should == ['54', '11', '1234', '5678']
17
+ Phony.split('542911234567').should == ['54', '291', '123', '4567']
18
+ Phony.split('542965123456').should == ['54', '2965', '12', '3456']
19
+ Phony.split('5491112345678').should == ['54', '911', '1234', '5678']
20
+ Phony.split('5492201234567').should == ['54', '9220', '123', '4567']
21
+ Phony.split('5492221123456').should == ['54', '92221', '12', '3456']
22
+ end
15
23
  it 'handles austrian numbers' do
16
24
  Phony.split('43198110').should == ['43', '1', '98110'] # Vienna
17
25
  Phony.split('4366914093902').should == ['43', '669', '14093902'] # Mobile
metadata CHANGED
@@ -1,28 +1,26 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: phony
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.2
4
5
  prerelease:
5
- version: 1.5.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Florian Hanke
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-10-22 00:00:00 +11:00
12
+ date: 2011-10-26 00:00:00.000000000 +11:00
14
13
  default_executable:
15
14
  dependencies: []
16
-
17
- description: "Fast international phone number (E164 standard) normalizing, splitting and formatting. Lots of formatting options: International (+.., 00..), national (0..), and local)."
15
+ description: ! 'Fast international phone number (E164 standard) normalizing, splitting
16
+ and formatting. Lots of formatting options: International (+.., 00..), national
17
+ (0..), and local).'
18
18
  email: florian.hanke+phony@gmail.com
19
19
  executables: []
20
-
21
20
  extensions: []
22
-
23
- extra_rdoc_files:
21
+ extra_rdoc_files:
24
22
  - README.textile
25
- files:
23
+ files:
26
24
  - lib/phony/countries/austria.rb
27
25
  - lib/phony/countries/china.rb
28
26
  - lib/phony/countries/germany.rb
@@ -64,32 +62,30 @@ files:
64
62
  has_rdoc: true
65
63
  homepage: http://github.com/floere/phony
66
64
  licenses: []
67
-
68
65
  post_install_message:
69
66
  rdoc_options: []
70
-
71
- require_paths:
67
+ require_paths:
72
68
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
69
+ required_ruby_version: !ruby/object:Gem::Requirement
74
70
  none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: "0"
79
- required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
76
  none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: "0"
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
85
81
  requirements: []
86
-
87
82
  rubyforge_project:
88
- rubygems_version: 1.5.0
83
+ rubygems_version: 1.6.2
89
84
  signing_key:
90
85
  specification_version: 3
91
- summary: Fast international phone number (E164 standard) normalizing, splitting and formatting.
92
- test_files:
86
+ summary: Fast international phone number (E164 standard) normalizing, splitting and
87
+ formatting.
88
+ test_files:
93
89
  - spec/lib/phony/countries_spec.rb
94
90
  - spec/lib/phony/country_codes_spec.rb
95
91
  - spec/lib/phony/country_spec.rb