torasup 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/torasup/operator.rb +4 -0
- data/lib/torasup/version.rb +1 -1
- data/lib/torasup.rb +4 -0
- data/spec/torasup/operator_spec.rb +26 -3
- data/torasup.gemspec +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bcfb1ffbd42ca86f97773f2febf32f945141f60
|
4
|
+
data.tar.gz: 9c421d8d53db393fd4987159895616d4607e5ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f748990a8e8bd46ba202d18d6c833fc53cf9ba4cfaa34f252b1b89a9b056db57efed8fc6b063d7a99b1d7564808da9d3de9b1c7fd3d61b780f2aeb16a610c2ac
|
7
|
+
data.tar.gz: 34119686c1361a051652d5a532f0ad3876a882fd19608f621451820f35129c0663b50659c2ba1bafdd8eb975b924fea2ba94c85b1fac7bd8c303dee7bdfe7b38
|
data/README.md
CHANGED
@@ -114,6 +114,9 @@ Sometimes you may only be interested in certain prefixes. For example let's say
|
|
114
114
|
> register_operators("kh", "metfone")
|
115
115
|
> end
|
116
116
|
|
117
|
+
> Torasup::Operator.registered
|
118
|
+
=> {"kh"=>["metfone"]}
|
119
|
+
|
117
120
|
> Torasup::Operator.registered_prefixes
|
118
121
|
=> ["85597", "85588"]
|
119
122
|
|
data/lib/torasup/operator.rb
CHANGED
data/lib/torasup/version.rb
CHANGED
data/lib/torasup.rb
CHANGED
@@ -4,6 +4,31 @@ module Torasup
|
|
4
4
|
describe Operator do
|
5
5
|
include PstnHelpers
|
6
6
|
|
7
|
+
let(:operator) { sample_operator }
|
8
|
+
|
9
|
+
describe ".registered" do
|
10
|
+
context "given no operators have been registered" do
|
11
|
+
before do
|
12
|
+
clear_registered_operators
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return an empty hash" do
|
16
|
+
Operator.registered.should == {}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "given one operator has been registered" do
|
21
|
+
before do
|
22
|
+
configure_registered_operators(operator[0], operator[1])
|
23
|
+
configure_with_custom_data(false)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should return a hash of countries with registerd operators" do
|
27
|
+
Operator.registered.should == {operator[0] => [operator[1]]}
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
7
32
|
describe ".registered_prefixes" do
|
8
33
|
context "given no operators have been registered" do
|
9
34
|
before do
|
@@ -16,14 +41,12 @@ module Torasup
|
|
16
41
|
end
|
17
42
|
|
18
43
|
context "given one operator has been registered" do
|
19
|
-
let(:operator) { sample_operator }
|
20
|
-
|
21
44
|
before do
|
22
45
|
configure_registered_operators(operator[0], operator[1])
|
23
46
|
configure_with_custom_data(false)
|
24
47
|
end
|
25
48
|
|
26
|
-
it "should the prefixes for that operator" do
|
49
|
+
it "should return the prefixes for that operator" do
|
27
50
|
Operator.registered_prefixes.should =~ prefixes(operator[0], operator[1])
|
28
51
|
end
|
29
52
|
end
|
data/torasup.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.description = %q{"Retuns metadata about a phone number such as operator, area code and more"}
|
12
12
|
gem.summary = %q{"Retuns metadata about a phone number such as operator, area code and more"}
|
13
13
|
gem.homepage = "https://github.com/dwilkie/torasup/"
|
14
|
+
gem.license = 'MIT'
|
14
15
|
|
15
16
|
gem.files = `git ls-files`.split($/)
|
16
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -22,5 +23,5 @@ Gem::Specification.new do |gem|
|
|
22
23
|
gem.add_runtime_dependency "deep_merge"
|
23
24
|
|
24
25
|
gem.add_development_dependency "rspec"
|
25
|
-
gem.add_development_dependency "rake"
|
26
|
+
gem.add_development_dependency "rake"
|
26
27
|
end
|
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Wilkie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: countries
|
@@ -113,7 +113,8 @@ files:
|
|
113
113
|
- spec/torasup/phone_number_spec.rb
|
114
114
|
- torasup.gemspec
|
115
115
|
homepage: https://github.com/dwilkie/torasup/
|
116
|
-
licenses:
|
116
|
+
licenses:
|
117
|
+
- MIT
|
117
118
|
metadata: {}
|
118
119
|
post_install_message:
|
119
120
|
rdoc_options: []
|