signalwire 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -2
- data/VERSION +1 -1
- data/lib/signalwire/sdk/twilio_set_host.rb +4 -4
- data/signalwire.gemspec +3 -3
- data/spec/signalwire/rest/client_spec.rb +9 -7
- data/spec/signalwire/sdk_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e788b6f367f9cb64b089e7b634bf093f0337cdd179c3e2cd95cc577133040274
|
4
|
+
data.tar.gz: 4f55aca3dd78982ffe8ff1a7e283f907cce852c41d324d546b5aef390d43d718
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0712ec51db60c88618c8139ecbc948bd25d2d840ffc70c7d434be2a04fdd8cfb25ed68b2cab01d6dea7b366e4c57281852ebbe90cdff986321b9e7f824d4ce22
|
7
|
+
data.tar.gz: 87d5a0aeeb38813745cd80e76516308b60608a3228142ae4e4561e8e900434cf9d2d5a3c48523cfc5daa8a0675b4060bf0d8923f2e0c35533eb75184cd8bc26f
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Add `gem 'signalwire'` to your `Gemfile`, or simply `gem install signalwire`.
|
|
10
10
|
|
11
11
|
## SDK Usage
|
12
12
|
|
13
|
-
Configure your signalwire subdomain, either by setting the environment variable `
|
13
|
+
Configure your signalwire subdomain, either by setting the environment variable `SIGNALWIRE_SPACE_URL=your_subdomain.signalwire.com` or within an
|
14
14
|
initializer:
|
15
15
|
|
16
16
|
```ruby
|
@@ -23,9 +23,22 @@ end
|
|
23
23
|
|
24
24
|
Then, setup a client to make requests, your `PROJECT_KEY` and `TOKEN` can be found within your Signalwire account, under Settings -> API Credentials
|
25
25
|
|
26
|
+
### Making a call
|
27
|
+
|
26
28
|
```ruby
|
27
29
|
@client = Signalwire::REST::Client.new PROJECT_KEY, TOKEN
|
28
30
|
|
31
|
+
@call = @client.calls.create(
|
32
|
+
from: '+15551234567',
|
33
|
+
to: '+15557654321',
|
34
|
+
url: "https://cdn.signalwire.com/default-music/playlist.xml",
|
35
|
+
method: "GET"
|
36
|
+
)
|
37
|
+
```
|
38
|
+
|
39
|
+
### Sending a text message
|
40
|
+
|
41
|
+
```ruby
|
29
42
|
@message = @client.messages.create(
|
30
43
|
from: '+15551234567',
|
31
44
|
to: '+15557654321',
|
@@ -33,7 +46,7 @@ Then, setup a client to make requests, your `PROJECT_KEY` and `TOKEN` can be fou
|
|
33
46
|
)
|
34
47
|
```
|
35
48
|
|
36
|
-
|
49
|
+
## Generating a LAML response
|
37
50
|
|
38
51
|
```
|
39
52
|
require 'signalwire/sdk'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
@@ -6,10 +6,10 @@ module Twilio
|
|
6
6
|
def initialize(twilio)
|
7
7
|
super
|
8
8
|
|
9
|
-
@host = ENV['
|
10
|
-
'Signalwire
|
11
|
-
'
|
12
|
-
@base_url = "https://#{@host}/api"
|
9
|
+
@host = ENV['SIGNALWIRE_SPACE_URL'] || Signalwire::Sdk.configuration.hostname || raise(ArgumentError,
|
10
|
+
'Signalwire Space URL is not configured. Enter your Signalwire Space domain via the '\
|
11
|
+
'SIGNALWIRE_SPACE_URL environment variable, or hostname in the configuration.')
|
12
|
+
@base_url = "https://#{@host}/api/laml"
|
13
13
|
@port = 443
|
14
14
|
|
15
15
|
# Versions
|
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.1.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.1.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 = "2018-10-
|
14
|
+
s.date = "2018-10-20"
|
15
15
|
s.email = "open.source@signalwire.com".freeze
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE.txt",
|
@@ -6,19 +6,19 @@ module Signalwire
|
|
6
6
|
RSpec.describe REST::Client do
|
7
7
|
it 'makes the correct request' do
|
8
8
|
Signalwire::Sdk.configure do |config|
|
9
|
-
config.hostname = '
|
9
|
+
config.hostname = 'myswspace.signalwire.com'
|
10
10
|
end
|
11
11
|
|
12
|
-
@client = Signalwire::REST::Client.new '
|
13
|
-
'
|
12
|
+
@client = Signalwire::REST::Client.new 'MYSWPROJECT',
|
13
|
+
'MYSWTOKEN'
|
14
14
|
|
15
|
-
stub = stub_request(:post, 'https://
|
15
|
+
stub = stub_request(:post, 'https://myswspace.signalwire.com/api/laml/2010-04-01/Accounts/MYSWPROJECT/Messages.json')
|
16
16
|
.with(body: { 'Body' => 'This is a message from the Signalwire-Ruby library!',
|
17
|
-
'From' => '+
|
17
|
+
'From' => '+15556677999', 'To' => '+15558866555' })
|
18
18
|
|
19
19
|
@message = @client.messages.create(
|
20
|
-
from: '+
|
21
|
-
to: '+
|
20
|
+
from: '+15556677999',
|
21
|
+
to: '+15558866555',
|
22
22
|
body: 'This is a message from the Signalwire-Ruby library!'
|
23
23
|
)
|
24
24
|
|
@@ -26,3 +26,5 @@ module Signalwire
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
|
data/spec/signalwire/sdk_spec.rb
CHANGED
@@ -20,7 +20,7 @@ RSpec.describe Signalwire::Sdk do
|
|
20
20
|
|
21
21
|
expect do
|
22
22
|
Twilio::REST::Client.new.api
|
23
|
-
end.to raise_exception ArgumentError, /Signalwire
|
23
|
+
end.to raise_exception ArgumentError, /Signalwire Space URL is not configured/
|
24
24
|
end
|
25
25
|
end
|
26
26
|
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.1.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: 2018-10-
|
11
|
+
date: 2018-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twilio-ruby
|