signalwire 1.3.0 → 1.4.0
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 +4 -4
- data/.drone.yml +13 -0
- data/CHANGELOG.md +5 -0
- data/README.md +6 -4
- data/VERSION +1 -1
- data/lib/signalwire/rest/client.rb +11 -0
- data/lib/signalwire/sdk/twilio_set_host.rb +2 -2
- data/signalwire.gemspec +4 -3
- data/spec/signalwire/sdk/configuration_spec.rb +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecfc761a788ea1f51afb5a6fb76b03548f688297f7b92de138e1b64c2bd01159
|
4
|
+
data.tar.gz: c5a163403dd5040df090cd5942f17c0d522b7b3e29672a9e1ec99a505254e403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38904d4aa3d5e1b09d69677f6797f8df55db93a46d72d11ec74f3b93aeee649e6f48b4d209139638a8c8db710a2554ab42150226077eab42b1fb5fdf1b061fa5
|
7
|
+
data.tar.gz: f02caa8270688fa1cd482da9042949113110cde811028bd7f089426bc98497bfaa3114f25a6ff3e75f9e3fd1b617a4159557769343854e8d919855fd09e51c25
|
data/.drone.yml
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,18 +2,20 @@
|
|
2
2
|
|
3
3
|
This gem provides a client for the Signalwire LAML and REST services.
|
4
4
|
|
5
|
-
It
|
5
|
+
It supports all of the features in the SignalWire REST API, and generation of LAML responses.
|
6
6
|
|
7
7
|
[](https://badge.fury.io/rb/signalwire)
|
8
8
|
|
9
|
+

|
10
|
+
|
9
11
|
## Installation
|
10
12
|
|
11
13
|
Add `gem 'signalwire'` to your `Gemfile`, or simply `gem install signalwire`.
|
12
14
|
|
13
15
|
## SDK Usage
|
14
16
|
|
15
|
-
Configure your signalwire subdomain, either by setting the environment
|
16
|
-
initializer:
|
17
|
+
Configure your signalwire subdomain, either by setting the environment variables `SIGNALWIRE_SPACE_URL` or `SIGNALWIRE_API_HOSTNAME` to `your_subdomain.signalwire.com` within an
|
18
|
+
initializer, or simply passing in the parameter to the constructor as seen below in the "Making a call" example:
|
17
19
|
|
18
20
|
```ruby
|
19
21
|
require 'signalwire/sdk'
|
@@ -28,7 +30,7 @@ Then, setup a client to make requests, your `PROJECT_KEY` and `TOKEN` can be fou
|
|
28
30
|
### Making a call
|
29
31
|
|
30
32
|
```ruby
|
31
|
-
@client = Signalwire::REST::Client.new PROJECT_KEY, TOKEN
|
33
|
+
@client = Signalwire::REST::Client.new PROJECT_KEY, TOKEN, signalwire_space_url: "your_subdomain.signalwire.com"
|
32
34
|
|
33
35
|
@call = @client.calls.create(
|
34
36
|
from: '+15551234567',
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
@@ -2,5 +2,16 @@
|
|
2
2
|
|
3
3
|
module Signalwire::REST
|
4
4
|
class Client < Twilio::REST::Client
|
5
|
+
def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=Twilio::HTTP::Client.new, **args)
|
6
|
+
signalwire_space_url = args.delete(:signalwire_space_url)
|
7
|
+
|
8
|
+
unless signalwire_space_url.nil?
|
9
|
+
Signalwire::Sdk.configure do |config|
|
10
|
+
config.hostname = signalwire_space_url
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
super(username, password, account_sid, region, http_client)
|
15
|
+
end
|
5
16
|
end
|
6
17
|
end
|
@@ -6,9 +6,9 @@ module Twilio
|
|
6
6
|
def initialize(twilio)
|
7
7
|
super
|
8
8
|
|
9
|
-
@host = ENV['SIGNALWIRE_SPACE_URL'] || Signalwire::Sdk.configuration.hostname || raise(ArgumentError,
|
9
|
+
@host = ENV['SIGNALWIRE_SPACE_URL'] || ENV['SIGNALWIRE_API_HOSTNAME'] || Signalwire::Sdk.configuration.hostname || raise(ArgumentError,
|
10
10
|
'SignalWire Space URL is not configured. Enter your SignalWire Space domain via the '\
|
11
|
-
'SIGNALWIRE_SPACE_URL environment
|
11
|
+
'SIGNALWIRE_SPACE_URL or SIGNALWIRE_API_HOSTNAME environment variables, or hostname in the configuration.')
|
12
12
|
@base_url = "https://#{@host}/api/laml"
|
13
13
|
@port = 443
|
14
14
|
|
data/signalwire.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: signalwire 1.
|
5
|
+
# stub: signalwire 1.4.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "signalwire".freeze
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.4.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["SignalWire Team".freeze]
|
14
|
-
s.date = "2019-
|
14
|
+
s.date = "2019-04-12"
|
15
15
|
s.email = "open.source@signalwire.com".freeze
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE.txt",
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
]
|
20
20
|
s.files = [
|
21
21
|
".document",
|
22
|
+
".drone.yml",
|
22
23
|
".rspec",
|
23
24
|
".rubocop.yml",
|
24
25
|
"AUTHORS.md",
|
@@ -17,5 +17,12 @@ module Signalwire
|
|
17
17
|
expect(config.hostname).to eq('test.signalwire.com')
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
describe 'setting up directly in the constructor' do
|
22
|
+
it 'sets the configuration in the constructor' do
|
23
|
+
client = Signalwire::REST::Client.new 'xyz123-xyz123-xyz123', 'PTxyz123-xyz123-xyz123', signalwire_space_url: 'test.signalwire.com'
|
24
|
+
expect(Signalwire::Sdk.configuration.hostname).to eq('test.signalwire.com')
|
25
|
+
end
|
26
|
+
end
|
20
27
|
end
|
21
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signalwire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SignalWire Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twilio-ruby
|
@@ -173,6 +173,7 @@ extra_rdoc_files:
|
|
173
173
|
- README.md
|
174
174
|
files:
|
175
175
|
- ".document"
|
176
|
+
- ".drone.yml"
|
176
177
|
- ".rspec"
|
177
178
|
- ".rubocop.yml"
|
178
179
|
- AUTHORS.md
|