pusher-client 0.5.0 → 0.6.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
  SHA1:
3
- metadata.gz: 1cc802ffe2416f85cd407687b0e23f82569c9f15
4
- data.tar.gz: 6af614c433c815e762fc308f0de05bd78e6f8e3c
3
+ metadata.gz: bf04dc511a185b1a37118fb7aa892d5f7582ae51
4
+ data.tar.gz: 39c0e1be1d0b4452804727e9f33237ea398bbd67
5
5
  SHA512:
6
- metadata.gz: 46fd409658e26cc23b41f77f94d789a61f7b2c9efb19535c3c9cf22c70da8146dacaafb803ae07eb5a0a7a8446b2739157509c3fc170fa7df337ab31111d5913
7
- data.tar.gz: a77689a96349a40d574b012f0d2f19df81c79b29d081b835ea0b67bd6ae3bc06758896eea0d91c897a19256e61607b366cd2f9ec5ac661f89467b2259f4a5e14
6
+ metadata.gz: d28001be9d6969ed7a86bcfbed7507e3f292cd518a5230acf3203cc8573e140af69315b53ba20adcf686c008bf48e133e73e8350bbabb75044d1787edc5dfaaf
7
+ data.tar.gz: f96d506e8b24e69b922233ed3a85f660bbbfcf2b5e962ca5e633f088339dc712e528a5ba6ba05512d687fc743520a7674b8c68962061d74c7b33a5941b2a329e
@@ -1,4 +1,10 @@
1
1
 
2
+ 0.6.0 / 2014-04-23
3
+ ==================
4
+
5
+ * options[:auth_method] for both private and presence channels
6
+ * Relax websocket dependency to any 1.x version
7
+
2
8
  0.5.0 / 2014-04-15
3
9
  ==================
4
10
 
@@ -23,7 +23,8 @@ module PusherClient
23
23
  @connected = false
24
24
  @encrypted = options[:encrypted] || false
25
25
  @logger = options[:logger] || PusherClient.logger
26
- @private_auth_method = options[:private_auth_method]
26
+ # :private_auth_method is deprecated
27
+ @auth_method = options[:auth_method] || options[:private_auth_method]
27
28
  @cert_file = options[:cert_file]
28
29
  @ws_host = options[:ws_host] || HOST
29
30
  @ws_port = options[:ws_port] || WS_PORT
@@ -157,19 +158,19 @@ module PusherClient
157
158
  end
158
159
 
159
160
  def get_private_auth(channel)
160
- if @private_auth_method.nil?
161
- string_to_sign = @socket_id + ':' + channel.name
162
- signature = hmac(@secret, string_to_sign)
163
- return "#{@key}:#{signature}"
164
- else
165
- return @private_auth_method.call(@socket_id, channel)
166
- end
161
+ return @auth_method.call(@socket_id, channel) if @auth_method
162
+
163
+ string_to_sign = @socket_id + ':' + channel.name
164
+ signature = hmac(@secret, string_to_sign)
165
+ "#{@key}:#{signature}"
167
166
  end
168
167
 
169
168
  def get_presence_auth(channel)
169
+ return @auth_method.call(@socket_id, channel) if @auth_method
170
+
170
171
  string_to_sign = @socket_id + ':' + channel.name + ':' + channel.user_data
171
172
  signature = hmac(@secret, string_to_sign)
172
- return "#{@key}:#{signature}"
173
+ "#{@key}:#{signature}"
173
174
  end
174
175
 
175
176
 
@@ -1,3 +1,3 @@
1
1
  module PusherClient
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.require_paths = ['lib']
22
22
  s.licenses = ['MIT']
23
23
 
24
- s.add_runtime_dependency 'websocket', '~> 1.1.2'
24
+ s.add_runtime_dependency 'websocket', '~> 1.0'
25
25
  s.add_runtime_dependency 'json'
26
26
 
27
27
  s.add_development_dependency "rspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pusher-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pusher
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-15 00:00:00.000000000 Z
12
+ date: 2014-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: websocket
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: 1.1.2
20
+ version: '1.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 1.1.2
27
+ version: '1.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: json
30
30
  requirement: !ruby/object:Gem::Requirement