pusher 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/CHANGELOG.md +6 -0
- data/README.md +7 -5
- data/lib/pusher.rb +2 -1
- data/lib/pusher/channel.rb +4 -0
- data/lib/pusher/client.rb +2 -0
- data/lib/pusher/native_notification/client.rb +1 -3
- data/lib/pusher/version.rb +1 -1
- data/pusher.gemspec +1 -0
- metadata +46 -28
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YThkNzIxNmMwMTgyY2ZhZmJlYjY3Njk1NGEzMDFiOWMxYzk5Mjc1MQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Mjk3MmUwODFhNDcxY2U1ZjVhZTlkMGUzYmZlMGE3NWY0ZGNkZGE3Mg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDllZTg5MzdiYzMyODFkZjE1M2QxMjEzNjcwMGQ0OGNlODhiY2Q2NmMzZDMy
|
10
|
+
ZTBiNzUyODYzYWE4NjQxNDE5OWQ2ZjIxMTMwYzUwYTdhNjkyNTY0OWZmMDQ2
|
11
|
+
YTA4NWVmMTJmMmZhMmFiNGY0NTM4Mjg5YjhlMDRhM2FkNDcxYWE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZGZmNzQ0YmExMGMzZjlkY2U2Yzk5MzgyMWUwOTJhNzFmYjkxNTFkMGZmODNl
|
14
|
+
MmI4OGJlMmI0OGJiZjZhN2MwYzE3MDJiZWUzNzlhNzE1NDQ0OTQzODQxNTdj
|
15
|
+
ZGMwNGExNDljYTU4MjY1OTBjMWYzZTIzM2Q2YTdkMTY4OWI2Mzc=
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
1.3.1 / 2017-03-15
|
2
|
+
==================
|
3
|
+
|
4
|
+
* Added missing client batch methods to default client delegations
|
5
|
+
* Document raised exception in the `authenticate` method
|
6
|
+
* Fixes em-http-request from using v2.5.0 of `addressable` breaking builds.
|
1
7
|
|
2
8
|
1.3.0 / 2016-08-23
|
3
9
|
==================
|
data/README.md
CHANGED
@@ -72,6 +72,12 @@ Pusher.key = 'your-pusher-key'
|
|
72
72
|
Pusher.secret = 'your-pusher-secret'
|
73
73
|
```
|
74
74
|
|
75
|
+
If you created your app in a different cluster to the default cluster, you must set it as follows:
|
76
|
+
|
77
|
+
``` ruby
|
78
|
+
Pusher.cluster = 'your-app-cluster'
|
79
|
+
```
|
80
|
+
|
75
81
|
Global configuration will automatically be set from the `PUSHER_URL` environment variable if it exists. This should be in the form `http://KEY:SECRET@api.pusherapp.com/apps/APP_ID`. On Heroku this environment variable will already be set.
|
76
82
|
|
77
83
|
If you need to make requests via a HTTP proxy then it can be configured
|
@@ -250,11 +256,7 @@ end
|
|
250
256
|
|
251
257
|
## Push Notifications (BETA)
|
252
258
|
|
253
|
-
Pusher now allows sending native notifications to iOS and Android devices. Check out the [documentation](https://pusher.com/docs/push_notifications) for information on how to set up push notifications on Android and iOS. There is no additional setup required to use it with this library. It works out of the box with the same Pusher instance. All you need are the same pusher credentials.
|
254
|
-
|
255
|
-
```
|
256
|
-
$ gem install pusher -v 1.2.0.rc4
|
257
|
-
```
|
259
|
+
Pusher now allows sending native notifications to iOS and Android devices. Check out the [documentation](https://pusher.com/docs/push_notifications) for information on how to set up push notifications on Android and iOS. There is no additional setup required to use it with this library. It works out of the box with the same Pusher instance. All you need are the same pusher credentials.
|
258
260
|
|
259
261
|
### Sending native pushes
|
260
262
|
|
data/lib/pusher.rb
CHANGED
@@ -37,7 +37,8 @@ module Pusher
|
|
37
37
|
def_delegators :default_client, :timeout=, :connect_timeout=, :send_timeout=, :receive_timeout=, :keep_alive_timeout=
|
38
38
|
|
39
39
|
def_delegators :default_client, :get, :get_async, :post, :post_async
|
40
|
-
def_delegators :default_client, :channels, :channel_info, :channel_users
|
40
|
+
def_delegators :default_client, :channels, :channel_info, :channel_users
|
41
|
+
def_delegators :default_client, :trigger, :trigger_batch, :trigger_async, :trigger_batch_async
|
41
42
|
def_delegators :default_client, :authenticate, :webhook, :channel, :[]
|
42
43
|
def_delegators :default_client, :notify
|
43
44
|
|
data/lib/pusher/channel.rb
CHANGED
@@ -120,6 +120,8 @@ module Pusher
|
|
120
120
|
# @param custom_string [String] Allows signing additional data
|
121
121
|
# @return [String]
|
122
122
|
#
|
123
|
+
# @raise [Pusher::Error] if socket_id or custom_string invalid
|
124
|
+
#
|
123
125
|
def authentication_string(socket_id, custom_string = nil)
|
124
126
|
validate_socket_id(socket_id)
|
125
127
|
|
@@ -157,6 +159,8 @@ module Pusher
|
|
157
159
|
#
|
158
160
|
# @return [Hash]
|
159
161
|
#
|
162
|
+
# @raise [Pusher::Error] if socket_id or custom_data is invalid
|
163
|
+
#
|
160
164
|
# @private Custom data is sent to server as JSON-encoded string
|
161
165
|
#
|
162
166
|
def authenticate(socket_id, custom_data = nil)
|
data/lib/pusher/client.rb
CHANGED
@@ -345,6 +345,8 @@ module Pusher
|
|
345
345
|
#
|
346
346
|
# @return [Hash]
|
347
347
|
#
|
348
|
+
# @raise [Pusher::Error] if channel_name or socket_id are invalid
|
349
|
+
#
|
348
350
|
# @private Custom data is sent to server as JSON-encoded string
|
349
351
|
#
|
350
352
|
def authenticate(channel_name, socket_id, custom_data = nil)
|
@@ -26,8 +26,6 @@ module Pusher
|
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
# TODO: Actual links
|
30
|
-
#
|
31
29
|
# {
|
32
30
|
# interests: [Array of interests],
|
33
31
|
# apns: {
|
@@ -38,7 +36,7 @@ module Pusher
|
|
38
36
|
# }
|
39
37
|
# }
|
40
38
|
#
|
41
|
-
# @raise [Pusher::Error] if the
|
39
|
+
# @raise [Pusher::Error] if the interests array is empty
|
42
40
|
# @return [String]
|
43
41
|
def payload(interests, data)
|
44
42
|
interests = Array(interests).map(&:to_s)
|
data/lib/pusher/version.rb
CHANGED
data/pusher.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_development_dependency "rspec", "~> 3.0"
|
22
22
|
s.add_development_dependency "webmock"
|
23
23
|
s.add_development_dependency "em-http-request", "~> 1.1.0"
|
24
|
+
s.add_development_dependency "addressable", "=2.4.0"
|
24
25
|
s.add_development_dependency "rake", "~> 10.4.2"
|
25
26
|
s.add_development_dependency "rack", "~> 1.6.4"
|
26
27
|
s.add_development_dependency "json", "~> 1.8.3"
|
metadata
CHANGED
@@ -1,139 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
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: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pusher-signature
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
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
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
47
|
version: '2.7'
|
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
54
|
version: '2.7'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ! '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: em-http-request
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.1.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.1.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: addressable
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.4.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.4.0
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ~>
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: 10.4.2
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ~>
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: 10.4.2
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rack
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- -
|
129
|
+
- - ~>
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: 1.6.4
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- -
|
136
|
+
- - ~>
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: 1.6.4
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: json
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- -
|
143
|
+
- - ~>
|
130
144
|
- !ruby/object:Gem::Version
|
131
145
|
version: 1.8.3
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- -
|
150
|
+
- - ~>
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: 1.8.3
|
139
153
|
description: Wrapper for pusher.com REST api
|
@@ -143,10 +157,10 @@ executables: []
|
|
143
157
|
extensions: []
|
144
158
|
extra_rdoc_files: []
|
145
159
|
files:
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
160
|
+
- .document
|
161
|
+
- .gemtest
|
162
|
+
- .gitignore
|
163
|
+
- .travis.yml
|
150
164
|
- CHANGELOG.md
|
151
165
|
- Gemfile
|
152
166
|
- LICENSE
|
@@ -176,18 +190,22 @@ require_paths:
|
|
176
190
|
- lib
|
177
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
178
192
|
requirements:
|
179
|
-
- -
|
193
|
+
- - ! '>='
|
180
194
|
- !ruby/object:Gem::Version
|
181
195
|
version: '0'
|
182
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
197
|
requirements:
|
184
|
-
- -
|
198
|
+
- - ! '>='
|
185
199
|
- !ruby/object:Gem::Version
|
186
200
|
version: '0'
|
187
201
|
requirements: []
|
188
202
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.6.10
|
190
204
|
signing_key:
|
191
205
|
specification_version: 4
|
192
206
|
summary: Pusher API client
|
193
|
-
test_files:
|
207
|
+
test_files:
|
208
|
+
- spec/channel_spec.rb
|
209
|
+
- spec/client_spec.rb
|
210
|
+
- spec/spec_helper.rb
|
211
|
+
- spec/web_hook_spec.rb
|