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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38a1b1607ab0d444d3d58655a0dc2b5808a89fa4
4
- data.tar.gz: a5e31bb866bc8f48ad01054d1f70045cf84d746b
3
+ metadata.gz: f52c790e1e2c9af2cb3ac547fb72bc37b6b04d50
4
+ data.tar.gz: fbd3c72931340eb1e8f87c9fed20c0b31e018a0e
5
5
  SHA512:
6
- metadata.gz: 6c5bfcff26cf14b563cf4017ebb6082b6c6cad08472b95b0a9c809bec15698d600a4b2727bff5a13d0e0c51d402ea2c420bd8350f296f86ea07c259261a5bdb7
7
- data.tar.gz: 9cbfebfe0e27f2d80619eee4dcc907e6019312d6f778a6f76993224fc8d82e5ceffa53758c32d7c556b1b933e23615a029a091836c555ded0edcff95243bb128
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+).*app_id=(?<app_id>\d+)/i
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?
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
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.0
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-18 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty