stream-ruby 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stream/client.rb +3 -1
- data/lib/stream/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f52c790e1e2c9af2cb3ac547fb72bc37b6b04d50
|
4
|
+
data.tar.gz: fbd3c72931340eb1e8f87c9fed20c0b31e018a0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39bf92a3619ccdfe076145ec426e18b9642c6523c8f93d25445b5cae755e19f59a263a7b3d33a28754530544f3f816e67c31ae1e0ec42a85a853cd451509d533
|
7
|
+
data.tar.gz: 77bc6255bca93cb977fd2b01f5471b376f50d7df81fddfc17b2200460485c7efe1b58ecbf469415e4dc6c064792a9ae0ee6aad83a397c9bd30226dcf199d1cf6
|
data/lib/stream/client.rb
CHANGED
@@ -5,7 +5,7 @@ require 'stream/signer'
|
|
5
5
|
|
6
6
|
|
7
7
|
module Stream
|
8
|
-
STREAM_URL_RE = /https\:\/\/(?<key>\w+)\:(?<secret>\w+)
|
8
|
+
STREAM_URL_RE = /https\:\/\/(?<key>\w+)\:(?<secret>\w+)@((api\.)|(api-(?<location>[-\w]+)\.))?getstream\.io\/?*.app_id=(?<app_id>\d+)/i
|
9
9
|
|
10
10
|
class Client
|
11
11
|
attr_reader :api_key
|
@@ -15,11 +15,13 @@ module Stream
|
|
15
15
|
attr_reader :location
|
16
16
|
|
17
17
|
def initialize(api_key='', api_secret='', app_id=nil, opts={})
|
18
|
+
|
18
19
|
if ENV['STREAM_URL'] =~ Stream::STREAM_URL_RE and (api_key.nil? || api_key.empty?)
|
19
20
|
matches = Stream::STREAM_URL_RE.match(ENV['STREAM_URL'])
|
20
21
|
api_key = matches['key']
|
21
22
|
api_secret = matches['secret']
|
22
23
|
app_id = matches['app_id']
|
24
|
+
opts[:location] = matches['location']
|
23
25
|
end
|
24
26
|
|
25
27
|
if api_key.nil? || api_key.empty?
|
data/lib/stream/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stream-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommaso Barbugli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|