twilio_mock 0.4.4 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/twilio_extensions.rb +8 -4
- data/lib/twilio_mock/mocker.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2aad63f29b353ddd775a53e0e999d1675186a1e
|
4
|
+
data.tar.gz: 3abd634806454e4f30dd386276c2b814cba410c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c45553167f55cfbab343cdd4422128f22f07a00df0a62d687cfa0955f78001f8def5908c28b7876add022f97b7bfec05af13520d5e8bfd8da371baca1414237
|
7
|
+
data.tar.gz: d3f2a7f0dd2e77a1ce670e8e2f4fe7084213c0b7ba8e887e141c51a79cb68ab0932d9ef3642c8011782ec35288c6cb767d5d834f97bfe872e40eae17473d3c41
|
data/lib/twilio_extensions.rb
CHANGED
@@ -1,28 +1,32 @@
|
|
1
1
|
module TwilioExtensions
|
2
2
|
module AccountContext
|
3
3
|
def available_phone_numbers(country_code=:unset)
|
4
|
-
|
4
|
+
client = @version.instance_variable_get(:@domain).client
|
5
|
+
TwilioMock::Mocker.new(username: client.account_sid, token: client.auth_token).available_number if TwilioMock::Testing.enabled?
|
5
6
|
super(country_code)
|
6
7
|
end
|
7
8
|
end
|
8
9
|
|
9
10
|
module Messages
|
10
11
|
def create(attrs)
|
11
|
-
|
12
|
+
client = @version.instance_variable_get(:@domain).client
|
13
|
+
TwilioMock::Mocker.new(username: client.account_sid, token: client.auth_token).create_message(attrs) if TwilioMock::Testing.enabled?
|
12
14
|
super(attrs)
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
16
18
|
module IncomingPhoneNumbers
|
17
19
|
def create(attrs)
|
18
|
-
|
20
|
+
client = @version.instance_variable_get(:@domain).client
|
21
|
+
TwilioMock::Mocker.new(username: client.account_sid, token: client.auth_token).buy_number(attrs) if TwilioMock::Testing.enabled?
|
19
22
|
super(attrs)
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
23
26
|
module Lookups
|
24
27
|
def fetch(*)
|
25
|
-
|
28
|
+
client = @version.instance_variable_get(:@domain).client
|
29
|
+
TwilioMock::LookupMocker.new(username: client.account_sid, token: client.auth_token).lookup(@solution[:phone_number]) if TwilioMock::Testing.enabled?
|
26
30
|
super
|
27
31
|
end
|
28
32
|
end
|
data/lib/twilio_mock/mocker.rb
CHANGED
@@ -9,9 +9,9 @@ module TwilioMock
|
|
9
9
|
API_VERSION = '2010-04-01'.freeze
|
10
10
|
HOST = 'api.twilio.com'.freeze
|
11
11
|
|
12
|
-
def initialize
|
13
|
-
@username =
|
14
|
-
@token =
|
12
|
+
def initialize(username: Twilio.account_sid, token: Twilio.auth_token)
|
13
|
+
@username = username
|
14
|
+
@token = token
|
15
15
|
end
|
16
16
|
|
17
17
|
def create_message(attrs)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio_mock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maicol Bentancor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twilio-ruby
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.6.
|
88
|
+
rubygems_version: 2.6.14.1
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Mock for the twilio gem
|