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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4567ca0e9c75e90cfd2704e51aa64e9482d53327ff9132476cec52b3b804be79
4
- data.tar.gz: 2bd64750713bc6f359429958397fe27927f1be0d01bb890586df29c5450a0c64
3
+ metadata.gz: e788b6f367f9cb64b089e7b634bf093f0337cdd179c3e2cd95cc577133040274
4
+ data.tar.gz: 4f55aca3dd78982ffe8ff1a7e283f907cce852c41d324d546b5aef390d43d718
5
5
  SHA512:
6
- metadata.gz: f748eefe17a9b2ddb3476f72996b99eed0967818255496242922882c85985a93ce7caec575d108a90d31ce155e61ce758927e85816934334839678aa1904fca4
7
- data.tar.gz: 52209bc1025b2f7c21629013873f980840332d2c44be8429d09a29d50441a6261357f67b9c16c9290f7f20c3a2a877b61bc8363bd0dc93d70c720bcfaadd3991
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 `SIGNALWIRE_API_HOSTNAME=your_subdomain.signalwire.com` or within an
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
- ### Generating a LAML response
49
+ ## Generating a LAML response
37
50
 
38
51
  ```
39
52
  require 'signalwire/sdk'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -6,10 +6,10 @@ module Twilio
6
6
  def initialize(twilio)
7
7
  super
8
8
 
9
- @host = ENV['SIGNALWIRE_API_HOSTNAME'] || Signalwire::Sdk.configuration.hostname || raise(ArgumentError,
10
- 'Signalwire API Hostname is not configured. Enter your Signalwire hostname via the '\
11
- 'SIGNALWIRE_API_HOSTNAME environment variable, or hostname in the configuration.')
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
@@ -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.0.0 ruby lib
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.0.0"
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-04"
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 = 'lpradovera.signalwire.com'
9
+ config.hostname = 'myswspace.signalwire.com'
10
10
  end
11
11
 
12
- @client = Signalwire::REST::Client.new '29bba2d4-ddf1-4569-8b4a-5914440a5e13',
13
- 'PT23d3ccf519d347eb0492c48eec7e1f2dbcfdeba7d7b13e68'
12
+ @client = Signalwire::REST::Client.new 'MYSWPROJECT',
13
+ 'MYSWTOKEN'
14
14
 
15
- stub = stub_request(:post, 'https://lpradovera.signalwire.com/api/2010-04-01/Accounts/29bba2d4-ddf1-4569-8b4a-5914440a5e13/Messages.json')
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' => '+14043287360', 'To' => '+14043287174' })
17
+ 'From' => '+15556677999', 'To' => '+15558866555' })
18
18
 
19
19
  @message = @client.messages.create(
20
- from: '+14043287360',
21
- to: '+14043287174',
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
+
@@ -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 API Hostname is not configured/
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.0.0
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-04 00:00:00.000000000 Z
11
+ date: 2018-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twilio-ruby