pusher 1.3.2 → 1.3.3
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/README.md +10 -10
- data/lib/pusher/version.rb +1 -1
- data/pusher.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7460762ae77605d5132b729dfccf7610ec5eb956
|
4
|
+
data.tar.gz: bf8ce2cb6c8a433e261d0c314dc65ec56e6fe9f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98f95bce77fe09335f14f45b99edcf7e5d40f59cd1fd7660b3a6ba86678d34169747534bcdb9af64cdb364d60ca42ea03e1070e28594a5c4eacc5d34bfd75553
|
7
|
+
data.tar.gz: b79d4eba9c63c4a4e421b3d2f8a93f4017c9053d5dd6994d4405460c02f14a2c12aaadbff27408c88fc2a0b0df9871a45b309ca6683b9803c793b33e3c92eac6
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ or install via gem
|
|
18
18
|
gem install pusher
|
19
19
|
```
|
20
20
|
|
21
|
-
After registering at <https://dashboard.pusher.com/>, configure your
|
21
|
+
After registering at <https://dashboard.pusher.com/>, configure your Channels app with the security credentials.
|
22
22
|
|
23
23
|
### Instantiating a Pusher Channels client
|
24
24
|
|
@@ -62,7 +62,7 @@ channels_client = Pusher::Client.from_env
|
|
62
62
|
|
63
63
|
### Global configuration
|
64
64
|
|
65
|
-
|
65
|
+
The library can also be configured globally on the `Pusher` class.
|
66
66
|
|
67
67
|
``` ruby
|
68
68
|
Pusher.app_id = 'your-app-id'
|
@@ -92,9 +92,9 @@ As of version 0.12, SSL certificates are verified when using the synchronous htt
|
|
92
92
|
Pusher.default_client.sync_http_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
93
93
|
```
|
94
94
|
|
95
|
-
## Interacting with the
|
95
|
+
## Interacting with the Channels HTTP API
|
96
96
|
|
97
|
-
The
|
97
|
+
The `pusher` gem contains a number of helpers for interacting with the API. As a general rule, the library adheres to a set of conventions that we have aimed to make universal.
|
98
98
|
|
99
99
|
### Handling errors
|
100
100
|
|
@@ -155,7 +155,7 @@ This will continue to work, but has been replaced by `channels_client.trigger` w
|
|
155
155
|
|
156
156
|
### Getting information about the channels in your Pusher Channels app
|
157
157
|
|
158
|
-
This gem provides methods for accessing information from the [
|
158
|
+
This gem provides methods for accessing information from the [Channels HTTP API](https://pusher.com/docs/rest_api). The documentation also shows an example of the responses from each of the API endpoints.
|
159
159
|
|
160
160
|
The following methods are provided by the gem.
|
161
161
|
|
@@ -163,13 +163,13 @@ The following methods are provided by the gem.
|
|
163
163
|
|
164
164
|
- `channels_client.channel_users('channel_name')` returns a list of all the users subscribed to the channel.
|
165
165
|
|
166
|
-
- `channels_client.channels` returns information about all the channels in your
|
166
|
+
- `channels_client.channels` returns information about all the channels in your Channels application.
|
167
167
|
|
168
168
|
### Asynchronous requests
|
169
169
|
|
170
170
|
There are two main reasons for using the `_async` methods:
|
171
171
|
|
172
|
-
* In a web application where the response from the
|
172
|
+
* In a web application where the response from the Channels HTTP API is not used, but you'd like to avoid a blocking call in the request-response cycle
|
173
173
|
* Your application is running in an event loop and you need to avoid blocking the reactor
|
174
174
|
|
175
175
|
Asynchronous calls are supported either by using an event loop (eventmachine, preferred), or via a thread.
|
@@ -180,7 +180,7 @@ The following methods are available (in each case the calling interface matches
|
|
180
180
|
* `channels_client.post_async`
|
181
181
|
* `channels_client.trigger_async`
|
182
182
|
|
183
|
-
It is of course also possible to make calls to the
|
183
|
+
It is of course also possible to make calls to the Channels HTTP API via a job queue. This approach is recommended if you're sending a large number of events.
|
184
184
|
|
185
185
|
#### With EventMachine
|
186
186
|
|
@@ -197,7 +197,7 @@ channels_client.get_async("/channels").callback { |response|
|
|
197
197
|
}
|
198
198
|
```
|
199
199
|
|
200
|
-
A HTTP error or an error response from
|
200
|
+
A HTTP error or an error response from Channels will cause the errback to be called with an appropriate error object.
|
201
201
|
|
202
202
|
#### Without EventMachine
|
203
203
|
|
@@ -208,7 +208,7 @@ An `HTTPClient::Connection` object is returned immediately which can be [interro
|
|
208
208
|
|
209
209
|
## Authenticating subscription requests
|
210
210
|
|
211
|
-
It's possible to use the gem to authenticate subscription requests to private or presence channels. The `authenticate` method is available on a channel object for this purpose and returns a JSON object that can be returned to the client that made the request. More information on this authentication scheme can be found in the docs on <
|
211
|
+
It's possible to use the gem to authenticate subscription requests to private or presence channels. The `authenticate` method is available on a channel object for this purpose and returns a JSON object that can be returned to the client that made the request. More information on this authentication scheme can be found in the docs on <https://pusher.com/docs/channels/server_api/authenticating-users>
|
212
212
|
|
213
213
|
### Private channels
|
214
214
|
|
data/lib/pusher/version.rb
CHANGED
data/pusher.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["Pusher"]
|
10
10
|
s.email = ["support@pusher.com"]
|
11
11
|
s.homepage = "http://github.com/pusher/pusher-http-ruby"
|
12
|
-
s.summary = %q{Pusher API client}
|
13
|
-
s.description = %q{Wrapper for
|
12
|
+
s.summary = %q{Pusher Channels API client}
|
13
|
+
s.description = %q{Wrapper for Pusher Channels REST api: : https://pusher.com/channels}
|
14
14
|
s.license = "MIT"
|
15
15
|
|
16
16
|
s.add_dependency "multi_json", "~> 1.0"
|
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: 1.3.
|
4
|
+
version: 1.3.3
|
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: 2019-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -150,7 +150,7 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 1.8.3
|
153
|
-
description: Wrapper for
|
153
|
+
description: 'Wrapper for Pusher Channels REST api: : https://pusher.com/channels'
|
154
154
|
email:
|
155
155
|
- support@pusher.com
|
156
156
|
executables: []
|
@@ -200,10 +200,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
202
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.5.2.2
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
|
-
summary: Pusher API client
|
206
|
+
summary: Pusher Channels API client
|
207
207
|
test_files:
|
208
208
|
- spec/channel_spec.rb
|
209
209
|
- spec/client_spec.rb
|