signalwire 1.3.0 → 1.4.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: a80144d46e9bd7758cb3588fd96fe4a8ca868598949058e492dca9edaed9c70b
4
- data.tar.gz: ca5cda0db618955afbe8f35797590574e7db444d4dcc30c66f92aa48cd24422a
3
+ metadata.gz: ecfc761a788ea1f51afb5a6fb76b03548f688297f7b92de138e1b64c2bd01159
4
+ data.tar.gz: c5a163403dd5040df090cd5942f17c0d522b7b3e29672a9e1ec99a505254e403
5
5
  SHA512:
6
- metadata.gz: eafbc87230e4112f47e08d74e9cbaadac14039b0c694c9530373f7a1bcd11e25da0b8c6df53296fc0000a7b465c0b8ae5acea76d910ede6da2d57cbbaf84f6b6
7
- data.tar.gz: 219dadf606f467f9c1c0773152a90164e0fbcbef354c0403b27e01cca25e0cd72800c37232d5e0085e96e1f469b44e4eb5ba6113ccf666177a7f2cd0114cebb7
6
+ metadata.gz: 38904d4aa3d5e1b09d69677f6797f8df55db93a46d72d11ec74f3b93aeee649e6f48b4d209139638a8c8db710a2554ab42150226077eab42b1fb5fdf1b061fa5
7
+ data.tar.gz: f02caa8270688fa1cd482da9042949113110cde811028bd7f089426bc98497bfaa3114f25a6ff3e75f9e3fd1b617a4159557769343854e8d919855fd09e51c25
@@ -0,0 +1,13 @@
1
+ kind: pipeline
2
+ name: default
3
+
4
+ steps:
5
+ - name: test
6
+ image: ruby:2.5
7
+ commands:
8
+ - bundle install --jobs=3 --retry=3
9
+ - bundle exec rspec
10
+
11
+ trigger:
12
+ event: push
13
+
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.0
4
+
5
+ - Add ability to specify domain via parameter
6
+ - Accept both `SIGNALWIRE_SPACE_URL` and `SIGNALWIRE_API_HOSTNAME` variables for configuration
7
+
3
8
  ## 1.3.0
4
9
 
5
10
  - Fax REST API support, better tests
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 allows you to create calls, send messages, and generate LAML responses.
5
+ It supports all of the features in the SignalWire REST API, and generation of LAML responses.
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/signalwire.svg)](https://badge.fury.io/rb/signalwire)
8
8
 
9
+ ![Drone CI](https://ci.signalwire.com/api/badges/signalwire/signalwire-ruby/status.svg)
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 variable `SIGNALWIRE_SPACE_URL=your_subdomain.signalwire.com` or within an
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.3.0
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 variable, or hostname in the configuration.')
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
 
@@ -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.3.0 ruby lib
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.3.0"
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-01-15"
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.3.0
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-01-15 00:00:00.000000000 Z
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