nexmo 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/nexmo.rb +11 -1
- data/nexmo.gemspec +2 -2
- data/spec/nexmo_spec.rb +26 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16f62b49870328ce5fbc096543f5a984fe558836
|
4
|
+
data.tar.gz: 660c5909b6a715ddfd5e0edf97b8204e57a1e775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189fed1951c2e880eccfc8aeb11ea62087f9c4cbc52f0cfede16356f314958c37b00786e7c795e89833fb8834943c5e50d8640e528662e4eab90eb1442362555
|
7
|
+
data.tar.gz: e8446f7d4ee9cb7df574390aa3526cf1d607aaa6c1b4fffe5626f6d1775660733c4c0715aa7b979448b35e3b10d66c14bb2d3b92d09bf86dcf6ddc809231ea9c
|
data/README.md
CHANGED
data/lib/nexmo.rb
CHANGED
@@ -46,10 +46,16 @@ module Nexmo
|
|
46
46
|
get('/account/numbers', params)
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
49
|
+
def get_available_numbers(country_code, params = {})
|
50
50
|
get('/number/search', {:country => country_code}.merge(params))
|
51
51
|
end
|
52
52
|
|
53
|
+
def number_search(country_code, params = {})
|
54
|
+
Kernel.warn '[nexmo] #number_search is deprecated and will be removed, please use #get_available_numbers instead'
|
55
|
+
|
56
|
+
get_available_numbers(country_code, params)
|
57
|
+
end
|
58
|
+
|
53
59
|
def buy_number(params)
|
54
60
|
post('/number/buy', params)
|
55
61
|
end
|
@@ -118,6 +124,10 @@ module Nexmo
|
|
118
124
|
get('https://api.nexmo.com/verify/search/json', :request_id => id)
|
119
125
|
end
|
120
126
|
|
127
|
+
def control_verification_request(params)
|
128
|
+
post('https://api.nexmo.com/verify/control/json', params)
|
129
|
+
end
|
130
|
+
|
121
131
|
def request_number_insight(params)
|
122
132
|
post('/ni/json', params)
|
123
133
|
end
|
data/nexmo.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'nexmo'
|
3
|
-
s.version = '3.
|
3
|
+
s.version = '3.1.0'
|
4
4
|
s.license = 'LGPL-3.0'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ['Tim Craft']
|
7
7
|
s.email = ['mail@timcraft.com']
|
8
8
|
s.homepage = 'http://github.com/timcraft/nexmo'
|
9
|
-
s.description = '
|
9
|
+
s.description = 'Ruby client for the Nexmo API'
|
10
10
|
s.summary = 'See description'
|
11
11
|
s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE.txt README.md nexmo.gemspec)
|
12
12
|
s.required_ruby_version = '>= 1.9.3'
|
data/spec/nexmo_spec.rb
CHANGED
@@ -91,6 +91,20 @@ describe 'Nexmo::Client' do
|
|
91
91
|
|
92
92
|
@client.number_search(:CA, :size => 25).must_equal(@json_response_object)
|
93
93
|
end
|
94
|
+
|
95
|
+
it 'emits a deprecation warning' do
|
96
|
+
message = nil
|
97
|
+
|
98
|
+
url = "#@base_url/number/search?api_key=key&api_secret=secret&country=CA&size=25"
|
99
|
+
|
100
|
+
stub_request(:get, url).to_return(@json_response_body)
|
101
|
+
|
102
|
+
Kernel.stub :warn, proc { |msg| message = msg } do
|
103
|
+
@client.number_search(:CA, :size => 25)
|
104
|
+
end
|
105
|
+
|
106
|
+
message.must_match(/#number_search is deprecated/)
|
107
|
+
end
|
94
108
|
end
|
95
109
|
|
96
110
|
describe 'buy_number method' do
|
@@ -271,6 +285,16 @@ describe 'Nexmo::Client' do
|
|
271
285
|
end
|
272
286
|
end
|
273
287
|
|
288
|
+
describe 'control_verification_request method' do
|
289
|
+
it 'posts to the control json resource and returns the response object' do
|
290
|
+
url = "#@api_base_url/verify/control/json"
|
291
|
+
|
292
|
+
stub_request(:post, url).with(@form_urlencoded_data).to_return(@json_response_body)
|
293
|
+
|
294
|
+
@client.control_verification_request(request_id: '8g88g88eg8g8gg9g90', cmd: 'cancel')
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
274
298
|
describe 'request_number_insight method' do
|
275
299
|
it 'posts to the number insight resource and returns the response object' do
|
276
300
|
url = "#@base_url/ni/json"
|
@@ -294,13 +318,13 @@ describe 'Nexmo::Client' do
|
|
294
318
|
end
|
295
319
|
|
296
320
|
it 'provides an option for specifying a different hostname to connect to' do
|
297
|
-
url = "https://rest-sandbox.nexmo.com/
|
321
|
+
url = "https://rest-sandbox.nexmo.com/account/get-balance?api_key=key&api_secret=secret"
|
298
322
|
|
299
323
|
request = stub_request(:get, url).to_return(@json_response_body)
|
300
324
|
|
301
325
|
@client = Nexmo::Client.new(key: 'key', secret: 'secret', host: 'rest-sandbox.nexmo.com')
|
302
326
|
|
303
|
-
@client.
|
327
|
+
@client.get_balance
|
304
328
|
|
305
329
|
assert_requested(request)
|
306
330
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Craft
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.0'
|
55
|
-
description:
|
55
|
+
description: Ruby client for the Nexmo API
|
56
56
|
email:
|
57
57
|
- mail@timcraft.com
|
58
58
|
executables: []
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.4.5
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: See description
|