phonelib 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -246,4 +246,16 @@ class PhonelibTest < Test::Unit::TestCase
246
246
  assert phone.valid?
247
247
  end
248
248
  end
249
+
250
+ context 'issue #16' do
251
+ should 'parse as LT country' do
252
+ phone = Phonelib.parse('00370 611 11 111')
253
+ assert_equal 'LT', phone.country
254
+ end
255
+
256
+ should 'show correct international' do
257
+ phone = Phonelib.parse('370 611 11 111')
258
+ assert_equal '+370 611 11111', phone.international
259
+ end
260
+ end
249
261
  end
metadata CHANGED
@@ -1,73 +1,88 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonelib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
5
- prerelease:
4
+ version: 0.2.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Vadim Senderovich
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
- requirement: &21069160 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.1.0
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *21069160
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.1.0
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: sqlite3
27
- requirement: &21067140 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *21067140
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: nokogiri
38
- requirement: &21080420 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *21080420
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: pry
49
- requirement: &21079180 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *21079180
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: shoulda-context
60
- requirement: &21078100 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
- - - ! '>='
73
+ - - '>='
64
74
  - !ruby/object:Gem::Version
65
75
  version: '0'
66
76
  type: :development
67
77
  prerelease: false
68
- version_requirements: *21078100
69
- description: ! " Google libphonenumber library was taken as a basis for\n this
70
- gem. Gem uses its data file for validations and number formatting.\n"
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: |2
84
+ Google libphonenumber library was taken as a basis for
85
+ this gem. Gem uses its data file for validations and number formatting.
71
86
  email:
72
87
  - daddyzgm@gmail.com
73
88
  executables: []
@@ -76,150 +91,145 @@ extra_rdoc_files: []
76
91
  files:
77
92
  - data/phone_data.yml
78
93
  - data/PhoneNumberMetaData.xml
79
- - lib/validators/phone_validator.rb
94
+ - lib/phonelib.rb
95
+ - lib/phonelib/version.rb
80
96
  - lib/phonelib/phone.rb
81
97
  - lib/phonelib/core.rb
82
- - lib/phonelib/version.rb
83
- - lib/phonelib.rb
98
+ - lib/validators/phone_validator.rb
84
99
  - lib/tasks/phonelib_tasks.rake
85
100
  - MIT-LICENSE
86
101
  - Rakefile
87
102
  - README.rdoc
88
- - test/dummy/db/schema.rb
89
- - test/dummy/db/test.sqlite3
90
- - test/dummy/db/migrate/20130121173847_create_phones.rb
91
- - test/dummy/db/migrate/20130122075331_add_possible_number_to_phone.rb
92
- - test/dummy/db/development.sqlite3
93
- - test/dummy/config.ru
94
- - test/dummy/config/initializers/backtrace_silencers.rb
103
+ - test/phonelib_test.rb
104
+ - test/dummy/config/database.yml
105
+ - test/dummy/config/initializers/session_store.rb
95
106
  - test/dummy/config/initializers/wrap_parameters.rb
107
+ - test/dummy/config/initializers/secret_token.rb
96
108
  - test/dummy/config/initializers/mime_types.rb
109
+ - test/dummy/config/initializers/backtrace_silencers.rb
97
110
  - test/dummy/config/initializers/inflections.rb
98
- - test/dummy/config/initializers/session_store.rb
99
- - test/dummy/config/initializers/secret_token.rb
100
111
  - test/dummy/config/environments/development.rb
101
- - test/dummy/config/environments/production.rb
102
112
  - test/dummy/config/environments/test.rb
103
- - test/dummy/config/application.rb
104
- - test/dummy/config/boot.rb
113
+ - test/dummy/config/environments/production.rb
105
114
  - test/dummy/config/environment.rb
106
- - test/dummy/config/routes.rb
107
115
  - test/dummy/config/locales/en.yml
108
- - test/dummy/config/database.yml
109
- - test/dummy/public/422.html
110
- - test/dummy/public/404.html
111
- - test/dummy/public/favicon.ico
112
- - test/dummy/public/500.html
113
- - test/dummy/test/fixtures/phones.yml
114
- - test/dummy/test/unit/helpers/phones_helper_test.rb
115
- - test/dummy/test/unit/phone_test.rb
116
- - test/dummy/test/functional/phones_controller_test.rb
117
- - test/dummy/README.rdoc
118
- - test/dummy/log/development.log
119
- - test/dummy/log/test.log
120
- - test/dummy/Rakefile
121
- - test/dummy/script/rails
122
- - test/dummy/app/views/layouts/application.html.erb
123
- - test/dummy/app/views/phones/_form.html.erb
124
- - test/dummy/app/views/phones/index.html.erb
125
- - test/dummy/app/views/phones/show.html.erb
126
- - test/dummy/app/views/phones/edit.html.erb
127
- - test/dummy/app/views/phones/new.html.erb
116
+ - test/dummy/config/boot.rb
117
+ - test/dummy/config/application.rb
118
+ - test/dummy/config/routes.rb
128
119
  - test/dummy/app/models/phone.rb
129
- - test/dummy/app/helpers/application_helper.rb
130
- - test/dummy/app/helpers/phones_helper.rb
131
- - test/dummy/app/controllers/phones_controller.rb
132
120
  - test/dummy/app/controllers/application_controller.rb
121
+ - test/dummy/app/controllers/phones_controller.rb
122
+ - test/dummy/app/assets/stylesheets/application.css
133
123
  - test/dummy/app/assets/stylesheets/scaffold.css
134
124
  - test/dummy/app/assets/stylesheets/phones.css
135
- - test/dummy/app/assets/stylesheets/application.css
136
125
  - test/dummy/app/assets/javascripts/application.js
137
126
  - test/dummy/app/assets/javascripts/phones.js
127
+ - test/dummy/app/helpers/phones_helper.rb
128
+ - test/dummy/app/helpers/application_helper.rb
129
+ - test/dummy/app/views/layouts/application.html.erb
130
+ - test/dummy/app/views/phones/index.html.erb
131
+ - test/dummy/app/views/phones/_form.html.erb
132
+ - test/dummy/app/views/phones/new.html.erb
133
+ - test/dummy/app/views/phones/edit.html.erb
134
+ - test/dummy/app/views/phones/show.html.erb
135
+ - test/dummy/script/rails
136
+ - test/dummy/db/development.sqlite3
137
+ - test/dummy/db/migrate/20130121173847_create_phones.rb
138
+ - test/dummy/db/migrate/20130122075331_add_possible_number_to_phone.rb
139
+ - test/dummy/db/schema.rb
140
+ - test/dummy/db/test.sqlite3
141
+ - test/dummy/config.ru
142
+ - test/dummy/README.rdoc
143
+ - test/dummy/Rakefile
144
+ - test/dummy/log/test.log
145
+ - test/dummy/log/development.log
146
+ - test/dummy/public/404.html
147
+ - test/dummy/public/422.html
148
+ - test/dummy/public/500.html
149
+ - test/dummy/public/favicon.ico
150
+ - test/dummy/test/functional/phones_controller_test.rb
151
+ - test/dummy/test/fixtures/phones.yml
152
+ - test/dummy/test/unit/helpers/phones_helper_test.rb
153
+ - test/dummy/test/unit/phone_test.rb
138
154
  - test/test_helper.rb
139
- - test/phonelib_test.rb
140
155
  homepage: https://github.com/daddyz/phonelib
141
156
  licenses:
142
157
  - MIT
143
- post_install_message: ! " IMPORTANT NOTICE!\n Phone types were changed from
144
- camel case to snake case!\n Example: \":tollFree\" changed to \":toll_free\".\n
145
- \ Please update your app in case your are checking types!\n"
158
+ metadata: {}
159
+ post_install_message: |2
160
+ IMPORTANT NOTICE!
161
+ Phone types were changed from camel case to snake case!
162
+ Example: ":tollFree" changed to ":toll_free".
163
+ Please update your app in case your are checking types!
146
164
  rdoc_options: []
147
165
  require_paths:
148
166
  - lib
149
167
  required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
168
  requirements:
152
- - - ! '>='
169
+ - - '>='
153
170
  - !ruby/object:Gem::Version
154
171
  version: '0'
155
- segments:
156
- - 0
157
- hash: -2851070269880550341
158
172
  required_rubygems_version: !ruby/object:Gem::Requirement
159
- none: false
160
173
  requirements:
161
- - - ! '>='
174
+ - - '>='
162
175
  - !ruby/object:Gem::Version
163
176
  version: '0'
164
- segments:
165
- - 0
166
- hash: -2851070269880550341
167
177
  requirements: []
168
178
  rubyforge_project:
169
- rubygems_version: 1.8.17
179
+ rubygems_version: 2.0.3
170
180
  signing_key:
171
- specification_version: 3
181
+ specification_version: 4
172
182
  summary: Gem validates phone numbers with Google libphonenumber database
173
183
  test_files:
174
- - test/dummy/db/schema.rb
175
- - test/dummy/db/test.sqlite3
176
- - test/dummy/db/migrate/20130121173847_create_phones.rb
177
- - test/dummy/db/migrate/20130122075331_add_possible_number_to_phone.rb
178
- - test/dummy/db/development.sqlite3
179
- - test/dummy/config.ru
180
- - test/dummy/config/initializers/backtrace_silencers.rb
184
+ - test/phonelib_test.rb
185
+ - test/dummy/config/database.yml
186
+ - test/dummy/config/initializers/session_store.rb
181
187
  - test/dummy/config/initializers/wrap_parameters.rb
188
+ - test/dummy/config/initializers/secret_token.rb
182
189
  - test/dummy/config/initializers/mime_types.rb
190
+ - test/dummy/config/initializers/backtrace_silencers.rb
183
191
  - test/dummy/config/initializers/inflections.rb
184
- - test/dummy/config/initializers/session_store.rb
185
- - test/dummy/config/initializers/secret_token.rb
186
192
  - test/dummy/config/environments/development.rb
187
- - test/dummy/config/environments/production.rb
188
193
  - test/dummy/config/environments/test.rb
189
- - test/dummy/config/application.rb
190
- - test/dummy/config/boot.rb
194
+ - test/dummy/config/environments/production.rb
191
195
  - test/dummy/config/environment.rb
192
- - test/dummy/config/routes.rb
193
196
  - test/dummy/config/locales/en.yml
194
- - test/dummy/config/database.yml
195
- - test/dummy/public/422.html
196
- - test/dummy/public/404.html
197
- - test/dummy/public/favicon.ico
198
- - test/dummy/public/500.html
199
- - test/dummy/test/fixtures/phones.yml
200
- - test/dummy/test/unit/helpers/phones_helper_test.rb
201
- - test/dummy/test/unit/phone_test.rb
202
- - test/dummy/test/functional/phones_controller_test.rb
203
- - test/dummy/README.rdoc
204
- - test/dummy/log/development.log
205
- - test/dummy/log/test.log
206
- - test/dummy/Rakefile
207
- - test/dummy/script/rails
208
- - test/dummy/app/views/layouts/application.html.erb
209
- - test/dummy/app/views/phones/_form.html.erb
210
- - test/dummy/app/views/phones/index.html.erb
211
- - test/dummy/app/views/phones/show.html.erb
212
- - test/dummy/app/views/phones/edit.html.erb
213
- - test/dummy/app/views/phones/new.html.erb
197
+ - test/dummy/config/boot.rb
198
+ - test/dummy/config/application.rb
199
+ - test/dummy/config/routes.rb
214
200
  - test/dummy/app/models/phone.rb
215
- - test/dummy/app/helpers/application_helper.rb
216
- - test/dummy/app/helpers/phones_helper.rb
217
- - test/dummy/app/controllers/phones_controller.rb
218
201
  - test/dummy/app/controllers/application_controller.rb
202
+ - test/dummy/app/controllers/phones_controller.rb
203
+ - test/dummy/app/assets/stylesheets/application.css
219
204
  - test/dummy/app/assets/stylesheets/scaffold.css
220
205
  - test/dummy/app/assets/stylesheets/phones.css
221
- - test/dummy/app/assets/stylesheets/application.css
222
206
  - test/dummy/app/assets/javascripts/application.js
223
207
  - test/dummy/app/assets/javascripts/phones.js
208
+ - test/dummy/app/helpers/phones_helper.rb
209
+ - test/dummy/app/helpers/application_helper.rb
210
+ - test/dummy/app/views/layouts/application.html.erb
211
+ - test/dummy/app/views/phones/index.html.erb
212
+ - test/dummy/app/views/phones/_form.html.erb
213
+ - test/dummy/app/views/phones/new.html.erb
214
+ - test/dummy/app/views/phones/edit.html.erb
215
+ - test/dummy/app/views/phones/show.html.erb
216
+ - test/dummy/script/rails
217
+ - test/dummy/db/development.sqlite3
218
+ - test/dummy/db/migrate/20130121173847_create_phones.rb
219
+ - test/dummy/db/migrate/20130122075331_add_possible_number_to_phone.rb
220
+ - test/dummy/db/schema.rb
221
+ - test/dummy/db/test.sqlite3
222
+ - test/dummy/config.ru
223
+ - test/dummy/README.rdoc
224
+ - test/dummy/Rakefile
225
+ - test/dummy/log/test.log
226
+ - test/dummy/log/development.log
227
+ - test/dummy/public/404.html
228
+ - test/dummy/public/422.html
229
+ - test/dummy/public/500.html
230
+ - test/dummy/public/favicon.ico
231
+ - test/dummy/test/functional/phones_controller_test.rb
232
+ - test/dummy/test/fixtures/phones.yml
233
+ - test/dummy/test/unit/helpers/phones_helper_test.rb
234
+ - test/dummy/test/unit/phone_test.rb
224
235
  - test/test_helper.rb
225
- - test/phonelib_test.rb