twilio-ruby 3.4.1 → 3.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/twilio-ruby.rb CHANGED
@@ -7,7 +7,7 @@ require 'openssl'
7
7
  require 'base64'
8
8
  require 'jwt'
9
9
 
10
- require 'twilio-ruby/version'
10
+ require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
11
11
  require 'twilio-ruby/util'
12
12
  require 'twilio-ruby/util/request_validator'
13
13
  require 'twilio-ruby/util/capability'
@@ -9,7 +9,7 @@ module Twilio
9
9
  class Call < InstanceResource
10
10
  def initialize(uri, client, params={})
11
11
  super uri, client, params
12
- resource :recordings, :transcriptions
12
+ resource :recordings, :notifications
13
13
  end
14
14
 
15
15
  def redirect_to(url)
@@ -4,6 +4,7 @@ module Twilio
4
4
 
5
5
  class Recording < InstanceResource
6
6
  def initialize(uri, client, params={})
7
+ uri.sub! /\/Calls\/CA[^\/]+/, ''
7
8
  super uri, client, params
8
9
  resource :transcriptions
9
10
  # grab a reference to the client's connection object for streaming
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '3.4.1'
2
+ VERSION = '3.4.2'
3
3
  end
data/test/twilio_spec.rb CHANGED
@@ -16,9 +16,10 @@ describe Twilio::REST::Client do
16
16
 
17
17
  it 'should set up the proper default http ssl connection' do
18
18
  twilio = Twilio::REST::Client.new('someSid', 'someToken')
19
- twilio.instance_variable_get('@connection').address.should == 'api.twilio.com'
20
- twilio.instance_variable_get('@connection').port.should == 443
21
- twilio.instance_variable_get('@connection').use_ssl?.should == true
19
+ connection = twilio.instance_variable_get('@connection')
20
+ connection.address.should == 'api.twilio.com'
21
+ connection.port.should == 443
22
+ connection.use_ssl?.should == true
22
23
  end
23
24
 
24
25
  it 'should set up the requested ssl verification ca_file if provided' do
@@ -29,38 +30,42 @@ describe Twilio::REST::Client do
29
30
 
30
31
  it 'should set up the proper http ssl connection when a different domain is given' do
31
32
  twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com')
32
- twilio.instance_variable_get('@connection').address.should == 'api.faketwilio.com'
33
- twilio.instance_variable_get('@connection').port.should == 443
34
- twilio.instance_variable_get('@connection').use_ssl?.should == true
33
+ connection = twilio.instance_variable_get('@connection')
34
+ connection.address.should == 'api.faketwilio.com'
35
+ connection.port.should == 443
36
+ connection.use_ssl?.should == true
35
37
  end
36
38
 
37
39
  it 'should adjust the open and read timeouts on the underlying Net::HTTP object when asked' do
38
40
  timeout = rand(30)
39
41
  twilio = Twilio::REST::Client.new('someSid', 'someToken', :timeout => timeout)
40
- twilio.instance_variable_get('@connection').port.should == 443
41
- twilio.instance_variable_get('@connection').use_ssl?.should == true
42
- twilio.instance_variable_get('@connection').open_timeout.should == timeout
43
- twilio.instance_variable_get('@connection').read_timeout.should == timeout
42
+ connection = twilio.instance_variable_get('@connection')
43
+ connection.port.should == 443
44
+ connection.use_ssl?.should == true
45
+ connection.open_timeout.should == timeout
46
+ connection.read_timeout.should == timeout
44
47
  end
45
48
 
46
49
  it 'should set up the proper http ssl connection when a proxy_host is given' do
47
50
  twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com', :proxy_addr => 'localhost')
48
- twilio.instance_variable_get('@connection').proxy?.should == true
49
- twilio.instance_variable_get('@connection').proxy_address.should == 'localhost'
50
- twilio.instance_variable_get('@connection').proxy_port.should == 80
51
- twilio.instance_variable_get('@connection').address.should == 'api.faketwilio.com'
52
- twilio.instance_variable_get('@connection').port.should == 443
53
- twilio.instance_variable_get('@connection').use_ssl?.should == true
51
+ connection = twilio.instance_variable_get('@connection')
52
+ connection.proxy?.should == true
53
+ connection.proxy_address.should == 'localhost'
54
+ connection.proxy_port.should == 80
55
+ connection.address.should == 'api.faketwilio.com'
56
+ connection.port.should == 443
57
+ connection.use_ssl?.should == true
54
58
  end
55
59
 
56
60
  it 'should set up the proper http ssl connection when a proxy_host and proxy_port are given' do
57
61
  twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com', :proxy_addr => 'localhost', :proxy_port => 13128)
58
- twilio.instance_variable_get('@connection').proxy?.should == true
59
- twilio.instance_variable_get('@connection').proxy_address.should == 'localhost'
60
- twilio.instance_variable_get('@connection').proxy_port.should == 13128
61
- twilio.instance_variable_get('@connection').address.should == 'api.faketwilio.com'
62
- twilio.instance_variable_get('@connection').port.should == 443
63
- twilio.instance_variable_get('@connection').use_ssl?.should == true
62
+ connection = twilio.instance_variable_get('@connection')
63
+ connection.proxy?.should == true
64
+ connection.proxy_address.should == 'localhost'
65
+ connection.proxy_port.should == 13128
66
+ connection.address.should == 'api.faketwilio.com'
67
+ connection.port.should == 443
68
+ connection.use_ssl?.should == true
64
69
  end
65
70
 
66
71
  it 'should set up an accounts resources object' do
@@ -164,10 +169,10 @@ describe Twilio::REST::Call do
164
169
  call.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
165
170
  end
166
171
 
167
- it 'should set up a recordings resources object' do
172
+ it 'should set up a notifications resources object' do
168
173
  call = Twilio::REST::Call.new('someUri', 'someClient')
169
- call.respond_to?(:transcriptions).should == true
170
- call.transcriptions.instance_variable_get('@uri').should == 'someUri/Transcriptions'
174
+ call.respond_to?(:notifications).should == true
175
+ call.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
171
176
  end
172
177
  end
173
178
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 4
9
- - 1
10
- version: 3.4.1
9
+ - 2
10
+ version: 3.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Benton
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-09 00:00:00 -07:00
18
+ date: 2011-10-13 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency