pusher 0.14.2 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +13 -0
- data/lib/pusher/channel.rb +16 -2
- data/pusher.gemspec +3 -3
- data/spec/channel_spec.rb +9 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b01f88da67dca16b39dbf8294f56a38d9737e13
|
4
|
+
data.tar.gz: 56b1a23bc74b234a487319a22138323463f0271e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c95993afb1e953a5c6b0ea21e3ee26db91c0b89ba7e77bbb41965304dc81ed77810eafdffefc0da92347f977e374a710d5a0baa2e1f17c827eebd7d5540210f
|
7
|
+
data.tar.gz: a730e0e7f0285d0b522a5fb42e903a6ef42aee479037269f742b4a56d132392664220d6aca748cb840b32f9476f000fee782dd6c752dc0b1a3db959cfdc4b78c
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,17 @@
|
|
1
1
|
|
2
|
+
0.14.4 / 2015-01-20
|
3
|
+
==================
|
4
|
+
|
5
|
+
* SECURITY: Prevent timing attack, update signature to v0.1.8
|
6
|
+
* SECURITY: Prevent POODLE. Disable SSLv3, update httpclient to v2.5
|
7
|
+
* Fix channel name character limit.
|
8
|
+
* Adds support for listing users on a presence channel
|
9
|
+
|
10
|
+
0.14.3 / 2015-01-20
|
11
|
+
==================
|
12
|
+
|
13
|
+
Yanked, bad release
|
14
|
+
|
2
15
|
0.14.2 / 2014-10-16
|
3
16
|
==================
|
4
17
|
|
data/lib/pusher/channel.rb
CHANGED
@@ -10,8 +10,8 @@ module Pusher
|
|
10
10
|
@uri = base_url.dup
|
11
11
|
if Pusher::Channel::INVALID_CHANNEL_REGEX.match(name)
|
12
12
|
raise Pusher::Error, "Illegal channel name '#{name}'"
|
13
|
-
elsif name.length >
|
14
|
-
raise Pusher::Error, "Channel name too long (limit
|
13
|
+
elsif name.length > 164
|
14
|
+
raise Pusher::Error, "Channel name too long (limit 164 characters) '#{name}'"
|
15
15
|
end
|
16
16
|
@uri.path = @uri.path + "/channels/#{name}/"
|
17
17
|
@name = name
|
@@ -90,6 +90,20 @@ module Pusher
|
|
90
90
|
@client.get("/channels/#{name}", :info => attributes.join(','))
|
91
91
|
end
|
92
92
|
|
93
|
+
# Request users for a presence channel
|
94
|
+
# Only works on presence channels (see: http://pusher.com/docs/client_api_guide/client_presence_channels and https://pusher.com/docs/rest_api)
|
95
|
+
#
|
96
|
+
# @example Response
|
97
|
+
# [{"id"=>"4"}]
|
98
|
+
#
|
99
|
+
# @return [Hash] Array of user hashes for this channel
|
100
|
+
# @raise [Pusher::Error] on invalid Pusher response - see the error message for more details
|
101
|
+
# @raise [Pusher::HTTPError] on any error raised inside Net::HTTP - the original error is available in the original_error attribute
|
102
|
+
#
|
103
|
+
def users
|
104
|
+
@client.get("/channels/#{name}/users")[:users]
|
105
|
+
end
|
106
|
+
|
93
107
|
# Compute authentication string required as part of the authentication
|
94
108
|
# endpoint response. Generally the authenticate method should be used in
|
95
109
|
# preference to this one
|
data/pusher.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "pusher"
|
6
|
-
s.version = "0.14.
|
6
|
+
s.version = "0.14.4"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Pusher"]
|
9
9
|
s.email = ["support@pusher.com"]
|
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.license = "MIT"
|
14
14
|
|
15
15
|
s.add_dependency "multi_json", "~> 1.0"
|
16
|
-
s.add_dependency 'signature', "~> 0.1.
|
17
|
-
s.add_dependency "httpclient", "~> 2.
|
16
|
+
s.add_dependency 'signature', "~> 0.1.8"
|
17
|
+
s.add_dependency "httpclient", "~> 2.5"
|
18
18
|
s.add_dependency "jruby-openssl" if defined?(JRUBY_VERSION)
|
19
19
|
|
20
20
|
s.add_development_dependency "rspec", "~> 2.0"
|
data/spec/channel_spec.rb
CHANGED
@@ -76,7 +76,7 @@ describe Pusher::Channel do
|
|
76
76
|
@channel.info
|
77
77
|
end
|
78
78
|
|
79
|
-
it "should assemble the requested
|
79
|
+
it "should assemble the requested attributes into the info option" do
|
80
80
|
@client.should_receive(:get).with(anything, {
|
81
81
|
:info => "user_count,connection_count"
|
82
82
|
})
|
@@ -85,6 +85,14 @@ describe Pusher::Channel do
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
describe '#users' do
|
89
|
+
it "should call the Client#channel_users" do
|
90
|
+
@client.should_receive(:get).with("/channels/presence-mychannel/users").and_return({:users => {'id' => '4'}})
|
91
|
+
@channel = @client['presence-mychannel']
|
92
|
+
@channel.users
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
88
96
|
describe "#authentication_string" do
|
89
97
|
def authentication_string(*data)
|
90
98
|
lambda { @channel.authentication_string(*data) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pusher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
33
|
+
version: 0.1.8
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.
|
40
|
+
version: 0.1.8
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: httpclient
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
47
|
+
version: '2.5'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2.
|
54
|
+
version: '2.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.4.
|
173
|
+
rubygems_version: 2.4.2
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Pusher API client
|