plivo 4.0.0.beta.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b3769ca665c441fa19c2ac4aac8844876e6625a
4
- data.tar.gz: 5478cb00e8c5c79760447aabc913a7e64f9b9596
3
+ metadata.gz: 67ddbbf4767cb809f1a3de1c2a7a541b5f317771
4
+ data.tar.gz: 44f588880a060279674f01610df4844bf4162a4b
5
5
  SHA512:
6
- metadata.gz: 56dab2850afb6b10de0bb5ee58270cbb5495db06b46bff6eade3ea739798d19e83843fe0b2a19736199ca4a9fbf1333180a416d1943f227f3810c57d11652c8c
7
- data.tar.gz: 61496cb4d40060e34e635cbacfa1bb7e95a6fc2a5d4ec01b36c9187fd21b3785970178bfff456ba8781140b4c68103d406033d74cb2360092533b8718c91c354
6
+ metadata.gz: 9607c564e67682986ac75cf192b30feb1c2d3d3d4c0206717f19b44515908c9a0e752ea0d9125ab4c0ddb5b8425ac72c63a1390806b3c12d0fcd62dbfa2b6d51
7
+ data.tar.gz: 17b9f7ea9874dcaeb535483246722128d3b4fadff0f6571fec1527695ce25e0b0bd88691cf9b5bcb2d9d467e07fd75c5aabf66586415e2232473d05d346711b9
data/CHANGELOG.md CHANGED
@@ -1,4 +1,15 @@
1
1
  # Change Log
2
+
3
+ ## [4.0.0](https://github.com/plivo/plivo-ruby/releases/tag/v4.0.0) (2018-01-18)
4
+ - Now supports timeout & proxy (in a non-deprecated way) settings
5
+ - A bug fixed (#55)
6
+
7
+ ## [4.0.0.beta.2](https://github.com/plivo/plivo-ruby/releases/tag/v4.0.0.beta.2) (2017-10-24)
8
+ - The new SDK works with Ruby >= 2. Tested against 2.0.0, 2.1, 2.2.0, 2.3.0, 2.4.0, 2.5-dev.
9
+ - JSON serialization and deserialization is now handled by the SDK
10
+ - The API interfaces are consistent and guessable
11
+ - Handles pagination automatically when listing all objects of a resource
12
+
2
13
  ## [v0.3.19](https://github.com/plivo/plivo-ruby/tree/v0.3.19) (2015-11-24)
3
14
  - Add `modify_number` function
4
15
 
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2017, Plivo Inc.
1
+ Copyright (C) 2018, Plivo Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of
4
4
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # plivo-ruby
2
+
3
+ [![Build Status](https://travis-ci.org/plivo/plivo-ruby.svg?branch=4.0)](https://travis-ci.org/plivo/plivo-ruby)
4
+
2
5
  The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby applications using the Plivo REST API. Using the SDK, you will be able to make voice calls, send SMS and generate Plivo XML to control your call flows.
3
6
 
4
7
  ## Installation
5
8
  Add this line to your application's Gemfile:
6
9
 
7
10
  ```ruby
8
- gem 'plivo', '>= 4.0.0.beta.1'
11
+ gem 'plivo', '>= 4.0.0'
9
12
  ```
10
13
 
11
14
  And then execute:
@@ -14,14 +17,14 @@ And then execute:
14
17
 
15
18
  Or install it yourself as:
16
19
 
17
- $ gem install plivo --pre
20
+ $ gem install plivo
18
21
 
19
22
  If you have the `0.3.19` version (a.k.a legacy) already installed, you may have to first uninstall it before installing the new version.
20
23
 
21
24
  ## Getting started
22
25
 
23
26
  ### Authentication
24
- To make the API requests, you need create a `RestClient` and provide it with authentication credentials (which can be found at [https://manage.plivo.com/dashboard/](https://manage.plivo.com/dashboard/)).
27
+ To make the API requests, you need to create a `RestClient` and provide it with authentication credentials (which can be found at [https://manage.plivo.com/dashboard/](https://manage.plivo.com/dashboard/)).
25
28
 
26
29
  We recommend that you store your credentials in the `PLIVO_AUTH_ID` and the `PLIVO_AUTH_TOKEN` environment variables, so as to avoid the possibility of accidentally committing them to source control. If you do this, you can initialise the client with no arguments and it will automatically fetch them from the environment variables:
27
30
 
@@ -126,4 +129,4 @@ This generates the following XML:
126
129
  Refer to the [Ruby API Reference](https://api-reference.plivo.com/latest/ruby/introduction/overview) for more examples. Also refer to the [guide to setting up dev environment](https://developers.plivo.com/getting-started/setting-up-dev-environment/) on [Plivo Developers Portal](https://developers.plivo.com) to setup a Sinatra server & use it to test out your integration in under 5 minutes.
127
130
 
128
131
  ## Reporting issues
129
- Report any feedback or problems with this beta version by [opening an issue on Github](https://github.com/plivo/plivo-ruby/issues).
132
+ Report any feedback or problems with this version by [opening an issue on Github](https://github.com/plivo/plivo-ruby/issues).
@@ -19,9 +19,10 @@ module Plivo
19
19
  attr_reader :pricings, :numbers, :calls, :conferences
20
20
  attr_reader :phone_numbers, :applications, :endpoints
21
21
 
22
- def initialize(auth_id = nil, auth_token = nil, proxy_options = nil)
22
+ def initialize(auth_id = nil, auth_token = nil, proxy_options = nil, timeout=5)
23
23
  configure_credentials(auth_id, auth_token)
24
24
  configure_proxies(proxy_options)
25
+ configure_timeout(timeout)
25
26
  configure_headers
26
27
  configure_connection
27
28
  configure_interfaces
@@ -46,6 +47,8 @@ module Plivo
46
47
  end
47
48
 
48
49
  def send_request(resource_path, method = 'GET', data = {}, timeout = nil)
50
+ timeout ||= @timeout
51
+
49
52
  response = case method
50
53
  when 'GET' then send_get(resource_path, data, timeout)
51
54
  when 'POST' then send_post(resource_path, data, timeout)
@@ -90,6 +93,10 @@ module Plivo
90
93
  }
91
94
  end
92
95
 
96
+ def configure_timeout(timeout)
97
+ @timeout = timeout
98
+ end
99
+
93
100
  def user_agent
94
101
  "plivo-ruby/#{Plivo::VERSION} (Ruby #{RUBY_VERSION})"
95
102
  end
@@ -125,7 +132,7 @@ module Plivo
125
132
 
126
133
  faraday.basic_auth(auth_id, auth_token)
127
134
 
128
- faraday.proxy(@proxy_hash) if @proxy_hash
135
+ faraday.proxy=@proxy_hash if @proxy_hash
129
136
  faraday.response :json, content_type: /\bjson$/
130
137
  faraday.adapter Faraday.default_adapter
131
138
  end
data/lib/plivo/utils.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'openssl'
2
2
  require 'uri'
3
+ require 'base64'
3
4
 
4
5
  module Plivo
5
6
  # Utils module
data/lib/plivo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = '4.0.0.beta.2'.freeze
2
+ VERSION = '4.0.0'.freeze
3
3
  end
data/plivo.gemspec CHANGED
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
27
27
  end
28
28
 
29
29
  spec.bindir = 'bin'
30
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
31
30
  spec.require_paths = ['lib']
32
31
 
33
32
  spec.required_ruby_version = '>= 2.0.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plivo
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.beta.2
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Plivo SDKs Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -128,9 +128,7 @@ description: The Plivo Ruby SDK makes it simpler to integrate communications int
128
128
  https://github.com/plivo/plivo-ruby for more information.
129
129
  email:
130
130
  - sdks@plivo.com
131
- executables:
132
- - console
133
- - setup
131
+ executables: []
134
132
  extensions: []
135
133
  extra_rdoc_files: []
136
134
  files:
@@ -143,8 +141,6 @@ files:
143
141
  - LICENSE.txt
144
142
  - README.md
145
143
  - Rakefile
146
- - bin/console
147
- - bin/setup
148
144
  - lib/plivo.rb
149
145
  - lib/plivo/base.rb
150
146
  - lib/plivo/base/resource.rb
@@ -198,9 +194,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
194
  version: 2.0.0
199
195
  required_rubygems_version: !ruby/object:Gem::Requirement
200
196
  requirements:
201
- - - ">"
197
+ - - ">="
202
198
  - !ruby/object:Gem::Version
203
- version: 1.3.1
199
+ version: '0'
204
200
  requirements: []
205
201
  rubyforge_project:
206
202
  rubygems_version: 2.6.11