twilio-ruby 5.2.1 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2af2bf820a3fb5e86dac192777b9fa9033838f58
4
- data.tar.gz: 9c2a731cf45ccc73b532590f8c557facb6831cce
3
+ metadata.gz: c74ddae744865799fc9de4d040d7e76e03a00af5
4
+ data.tar.gz: c2c329a9cf5fa999f5f8b5aab65ad2b9eceb1e37
5
5
  SHA512:
6
- metadata.gz: 3ea412fd75b56cd6c192b945a8cb24539137cab3c1d0efe1a6a9d4d503e3b02f6b06b2a7d1905f6d1d1375209b06fe6c9cd6c12a6c886f6bd2942d4da1d6afaf
7
- data.tar.gz: 3b5d3ad04265157711e657703e3768ee1140d58b8a927a3f6b152a16881a86308a95a3dbe1ef85d4e85a3ce1e17e9d728150fdf2cf8d711e99af02bbfe28d5d3
6
+ metadata.gz: 384d64e79b01344c0e645ba553cf43bedf760d5e392e020cff47adfdbd1bdf1de0cb590a0f9d4819468b8a63a66e914a7832af03685a4f231241b848d7fba000
7
+ data.tar.gz: d4a1539831a044d612d2fae57b888ee45384208ac68a9af3841e79f438d64eee5cc060c3156a3997ede480303b3edf63b7136f16203e7597ba90bbb17960850e
data/.travis.yml CHANGED
@@ -2,6 +2,7 @@ sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
4
  bundler_args: --without development
5
+
5
6
  rvm:
6
7
  - ruby-head
7
8
  - 2.4.0
@@ -9,5 +10,11 @@ rvm:
9
10
  - 2.2.0
10
11
  - 2.1
11
12
  - 2.0.0
13
+
12
14
  matrix:
13
15
  fast_finish: true
16
+
17
+ before_install:
18
+ # Bundler on Travis may be too out of date
19
+ # Update bundler to a recent version.
20
+ - gem install bundler
data/CHANGES.md CHANGED
@@ -1,6 +1,10 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2017-09-08] Version 5.2.2
5
+ ---------------------------
6
+ - Add configurable timeout to HttpClient
7
+
4
8
  [2017-09-01] Version 5.2.1
5
9
  ---------------------------
6
10
  **Sync**
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # twilio-ruby
2
2
 
3
3
  [![Build Status](http://img.shields.io/travis/twilio/twilio-ruby.svg)][travis]
4
- [![Gem Version](http://img.shields.io/gem/v/twilio-ruby.svg)][gem]
4
+ [![Gem Version](http://img.shields.io/gem/v/twilio-ruby.svg)](https://rubygems.org/gems/twilio-ruby)
5
5
  [![Code Quality](http://img.shields.io/codeclimate/github/twilio/twilio-ruby.svg)][codeclimate]
6
6
 
7
7
  A module for using the Twilio REST API and generating valid [TwiML](http://www.twilio.com/docs/api/twiml/ "TwiML - Twilio Markup Language"). [Click here to read the full documentation.][documentation]
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
27
27
  To install using [Bundler][bundler] grab the latest stable version:
28
28
 
29
29
  ```ruby
30
- gem 'twilio-ruby', '~> 5.2.1'
30
+ gem 'twilio-ruby', '~> 5.2.2'
31
31
  ```
32
32
 
33
33
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
34
34
 
35
35
  ```bash
36
- gem install twilio-ruby -v 5.2.1
36
+ gem install twilio-ruby -v 5.2.2
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
@@ -4,14 +4,16 @@ module Twilio
4
4
  module HTTP
5
5
  class Client
6
6
  attr_accessor :adapter
7
- attr_reader :last_response, :last_request
7
+ attr_reader :timeout, :last_response, :last_request
8
8
 
9
- def initialize(proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil, ssl_ca_file = nil)
9
+ def initialize(proxy_addr = nil, proxy_port = nil, proxy_user = nil, proxy_pass = nil, ssl_ca_file = nil,
10
+ timeout: nil)
10
11
  @proxy_addr = proxy_addr
11
12
  @proxy_port = proxy_port
12
13
  @proxy_user = proxy_user
13
14
  @proxy_pass = proxy_pass
14
15
  @ssl_ca_file = ssl_ca_file
16
+ @timeout = timeout
15
17
  @adapter = Faraday.default_adapter
16
18
  end
17
19
 
@@ -25,8 +27,8 @@ module Twilio
25
27
  if @proxy_addr
26
28
  f.proxy '#{@proxy_user}:#{@proxy_pass}@#{@proxy_addr}:#{@proxy_port}'
27
29
  end
28
- f.options.open_timeout = request.timeout
29
- f.options.timeout = request.timeout
30
+ f.options.open_timeout = request.timeout || @timeout
31
+ f.options.timeout = request.timeout || @timeout
30
32
  end
31
33
 
32
34
  @last_request = request
@@ -66,6 +66,9 @@ module Twilio
66
66
  # action:: Action URL
67
67
  # method:: Action URL method
68
68
  # timeout:: Time to wait to gather input
69
+ # speech_timeout:: Time to wait to gather speech input and it should be either auto or a positive integer.
70
+ # max_speech_time:: Max allowed time for speech input
71
+ # profanity_filter:: Profanity Filter on speech
69
72
  # finish_on_key:: Finish gather on key
70
73
  # num_digits:: Number of digits to collect
71
74
  # partial_result_callback:: Partial result callback URL
@@ -74,8 +77,8 @@ module Twilio
74
77
  # hints:: Speech recognition hints
75
78
  # barge_in:: Stop playing media upon speech
76
79
  # keyword_args:: additional attributes
77
- def gather(input: nil, action: nil, method: nil, timeout: nil, finish_on_key: nil, num_digits: nil, partial_result_callback: nil, partial_result_callback_method: nil, language: nil, hints: nil, barge_in: nil, **keyword_args)
78
- gather = Gather.new(input: input, action: action, method: method, timeout: timeout, finish_on_key: finish_on_key, num_digits: num_digits, partial_result_callback: partial_result_callback, partial_result_callback_method: partial_result_callback_method, language: language, hints: hints, barge_in: barge_in, **keyword_args)
80
+ def gather(input: nil, action: nil, method: nil, timeout: nil, speech_timeout: nil, max_speech_time: nil, profanity_filter: nil, finish_on_key: nil, num_digits: nil, partial_result_callback: nil, partial_result_callback_method: nil, language: nil, hints: nil, barge_in: nil, **keyword_args)
81
+ gather = Gather.new(input: input, action: action, method: method, timeout: timeout, speech_timeout: speech_timeout, max_speech_time: max_speech_time, profanity_filter: profanity_filter, finish_on_key: finish_on_key, num_digits: num_digits, partial_result_callback: partial_result_callback, partial_result_callback_method: partial_result_callback_method, language: language, hints: hints, barge_in: barge_in, **keyword_args)
79
82
 
80
83
  yield(gather) if block_given?
81
84
  append(gather)
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.2.1'
2
+ VERSION = '5.2.2'
3
3
  end
@@ -6,6 +6,34 @@ describe Twilio::HTTP::Client do
6
6
  @client = Twilio::HTTP::Client.new
7
7
  end
8
8
 
9
+ it 'should allow setting a global timeout' do
10
+ @client = Twilio::HTTP::Client.new(timeout: 10)
11
+ @connection = Faraday::Connection.new
12
+
13
+ expect(Faraday).to receive(:new).and_yield(@connection).and_return(@connection)
14
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
15
+
16
+ @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b'])
17
+
18
+ expect(@client.timeout).to eq(10)
19
+ expect(@connection.options.open_timeout).to eq(10)
20
+ expect(@connection.options.timeout).to eq(10)
21
+ end
22
+
23
+ it 'should allow overriding timeout per request' do
24
+ @client = Twilio::HTTP::Client.new(timeout: 10)
25
+ @connection = Faraday::Connection.new
26
+
27
+ expect(Faraday).to receive(:new).and_yield(@connection).and_return(@connection)
28
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
29
+
30
+ @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b'], 20)
31
+
32
+ expect(@client.timeout).to eq(10)
33
+ expect(@connection.options.open_timeout).to eq(20)
34
+ expect(@connection.options.timeout).to eq(20)
35
+ end
36
+
9
37
  it 'should contain a last response' do
10
38
  expect(Faraday).to receive(:new).and_return(Faraday::Connection.new)
11
39
  allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twilio API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-01 00:00:00.000000000 Z
11
+ date: 2017-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libxml-ruby