torasup 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +11 -2
- data/README.md +8 -6
- data/lib/torasup/data/pstn.yaml +13 -0
- data/lib/torasup/version.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/support/pstn_spec.yaml +14 -0
- data/torasup.gemspec +2 -0
- metadata +32 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 888eca4d5a8db09f5784bbb6de787143393a5f0b
|
4
|
+
data.tar.gz: 37652d228d0a9708775248cdef7f9f1ca496e163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e20aa4caea8eb67315a9425d1e27f19136aa6cdbac5c547008d1372b1a68e369efdc16cb37a12b16de8cd93bc3c9ee2c0e2a502620fea2bae43760cee7d00121
|
7
|
+
data.tar.gz: af5fa3eb04a5e85b951d77b8c70ce9b7ffab012550b984d3ebe657355fc3427408c88410696ecd9c53933e387e74f0905500dd1d8a9b98d9deb1047ff6b89880
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.2
|
data/.travis.yml
CHANGED
@@ -1,2 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
language: ruby
|
2
|
+
sudo: false
|
3
|
+
env:
|
4
|
+
global:
|
5
|
+
- START_SIMPLECOV=1
|
6
|
+
addons:
|
7
|
+
code_climate:
|
8
|
+
repo_token:
|
9
|
+
secure: "Xk7T8ZyorwO85WfXC7OB2HfIM9Z/GO85u97P1qwXukL1ZjjDffr3mzhh706AVA9JPpTQGDbLNU5aStxX6NVLjBXyflvEpSGmYLl0aHDVikcNvZA/jBGlIfJH/6/V5bJA11X3V2/9FeO5l2fPkusWxbcpAIowe7xclDXfujdoNGk="
|
10
|
+
after_success:
|
11
|
+
- bundle exec codeclimate-test-reporter
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
Retuns metadata about a phone number such as operator info, area code and more.
|
4
4
|
|
5
|
-
[![Build Status](https://travis-ci.org/
|
5
|
+
[![Build Status](https://travis-ci.org/somleng/torasup.png)](https://travis-ci.org/somleng/torasup)
|
6
|
+
[![Test Coverage](https://codeclimate.com/github/somleng/torasup/badges/coverage.svg)](https://codeclimate.com/github/somleng/torasup/coverage)
|
7
|
+
[![Code Climate](https://codeclimate.com/github/somleng/torasup/badges/gpa.svg)](https://codeclimate.com/github/somleng/torasup)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -89,7 +91,7 @@ Torasup.prefixes["8552345"]
|
|
89
91
|
|
90
92
|
### Overriding Data
|
91
93
|
|
92
|
-
Sometimes it maybe necessary to override the data that Torasup provides. For example you may want to provide custom attributes for different operators. In order to achieve this you can provide a custom [psdn](http://en.wikipedia.org/wiki/Public_switched_telephone_network) data file. Custom files also support interpolations using the `%{interpolation}` [I18n syntax](http://guides.rubyonrails.org/i18n.html#interpolation). See the format of sample custom [pstn data file](https://github.com/
|
94
|
+
Sometimes it maybe necessary to override the data that Torasup provides. For example you may want to provide custom attributes for different operators. In order to achieve this you can provide a custom [psdn](http://en.wikipedia.org/wiki/Public_switched_telephone_network) data file. Custom files also support interpolations using the `%{interpolation}` [I18n syntax](http://guides.rubyonrails.org/i18n.html#interpolation). See the format of sample custom [pstn data file](https://github.com/somleng/torasup/blob/master/spec/support/custom_pstn.yaml) for more info. e.g.
|
93
95
|
|
94
96
|
```yaml
|
95
97
|
# my_pstn_data.yaml
|
@@ -185,7 +187,7 @@ Torasup::PhoneNumber.new("+1 415-234 567").country_id
|
|
185
187
|
|
186
188
|
## Testing
|
187
189
|
|
188
|
-
Torasup exposes a few test helpers methods which you can use in your tests. See [the helper module](https://github.com/
|
190
|
+
Torasup exposes a few test helpers methods which you can use in your tests. See [the helper module](https://github.com/somleng/torasup/blob/master/lib/torasup/test/helpers.rb) for more info.
|
189
191
|
|
190
192
|
Here's an example using rspec:
|
191
193
|
|
@@ -203,7 +205,7 @@ describe User do
|
|
203
205
|
end
|
204
206
|
|
205
207
|
# provide a custom spec file for example see:
|
206
|
-
# see https://github.com/
|
208
|
+
# see https://github.com/somleng/torasup/blob/master/spec/support/custom_pstn_spec.yaml
|
207
209
|
def pstn_data(custom_spec = nil)
|
208
210
|
super("custom_operators_spec.yaml")
|
209
211
|
end
|
@@ -237,8 +239,8 @@ Sample numbers and assertions are only yielded for the operators defined in `ASS
|
|
237
239
|
|
238
240
|
### Data
|
239
241
|
|
240
|
-
When contributing data please ensure that you create or edit an entry in the [pstn spec](https://github.com/
|
242
|
+
When contributing data please ensure that you create or edit an entry in the [pstn spec](https://github.com/somleng/torasup/tree/master/spec/torasup/spec/support_pstn_spec.rb). This ensures the integrity of the data.
|
241
243
|
|
242
|
-
Please also include a link to Wikipedia article which verifies your data. See the [current psdn spec](https://github.com/
|
244
|
+
Please also include a link to Wikipedia article which verifies your data. See the [current psdn spec](https://github.com/somleng/torasup/blob/master/spec/support/pstn_spec.yaml) for an example that links to [Wikipedia](http://en.wikipedia.org/wiki/Telecommunications_in_Cambodia#Mobile_networks).
|
243
245
|
|
244
246
|
If you obtained operator prefixes from another source please clearly add these prefixes to the appropriate Wikipedia article and reference it if necessary. This helps ensure the accuracy of the gem.
|
data/lib/torasup/data/pstn.yaml
CHANGED
@@ -207,3 +207,16 @@ so:
|
|
207
207
|
prefixes:
|
208
208
|
- '61'
|
209
209
|
- '64'
|
210
|
+
sl:
|
211
|
+
# https://en.wikipedia.org/wiki/Telecommunications_in_Sierra_Leone
|
212
|
+
# https://en.wikipedia.org/wiki/List_of_mobile_network_operators_of_the_Middle_East_and_Africa#Sierra_Leone
|
213
|
+
international_dialing_code: "232"
|
214
|
+
operators:
|
215
|
+
africell:
|
216
|
+
# https://en.wikipedia.org/wiki/Africell
|
217
|
+
metadata:
|
218
|
+
name: "Africell"
|
219
|
+
prefixes:
|
220
|
+
- '30'
|
221
|
+
- '77'
|
222
|
+
- '88'
|
data/lib/torasup/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/support/pstn_spec.yaml
CHANGED
@@ -173,3 +173,17 @@ so:
|
|
173
173
|
prefixes:
|
174
174
|
- '61'
|
175
175
|
- '64'
|
176
|
+
sl:
|
177
|
+
prefix: "232"
|
178
|
+
local_number: "234567"
|
179
|
+
operators:
|
180
|
+
# https://en.wikipedia.org/wiki/Telecommunications_in_Sierra_Leone
|
181
|
+
# https://en.wikipedia.org/wiki/List_of_mobile_network_operators_of_the_Middle_East_and_Africa#Sierra_Leone
|
182
|
+
africell:
|
183
|
+
# https://en.wikipedia.org/wiki/Africell
|
184
|
+
assertions:
|
185
|
+
name: "Africell"
|
186
|
+
prefixes:
|
187
|
+
- '30'
|
188
|
+
- '77'
|
189
|
+
- '88'
|
data/torasup.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torasup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Wilkie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: countries
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: codeclimate-test-reporter
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.0.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.0.0
|
83
111
|
description: '"Retuns metadata about a phone number such as operator, area code and
|
84
112
|
more"'
|
85
113
|
email:
|
@@ -90,6 +118,7 @@ extra_rdoc_files: []
|
|
90
118
|
files:
|
91
119
|
- ".gitignore"
|
92
120
|
- ".rspec"
|
121
|
+
- ".ruby-version"
|
93
122
|
- ".travis.yml"
|
94
123
|
- Gemfile
|
95
124
|
- LICENSE.txt
|
@@ -135,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
164
|
version: '0'
|
136
165
|
requirements: []
|
137
166
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.6.
|
167
|
+
rubygems_version: 2.6.13
|
139
168
|
signing_key:
|
140
169
|
specification_version: 4
|
141
170
|
summary: '"Retuns metadata about a phone number such as operator, area code and more"'
|