cent 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +1 -1
- data/README.md +10 -11
- data/lib/cent/http.rb +1 -1
- data/lib/cent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b533a1550e369ce3cafb34965c09d01a66691249d58424306f1dddae06feb170
|
4
|
+
data.tar.gz: 861d3619f6110bdea4892bd8c09be01e22466d6f951007a5a2d05e2d0ffb092f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d827bcc6f421a1f9ab5a70f3cb17025bd2986247112888dfc3d53af494f88930deb8caca2556ceda27696d5da9979867d2bea32a3f598597dccc96c0d3b8d812
|
7
|
+
data.tar.gz: a7064d71efc537467ac5337182abe168e1d67a5e77365dac9a35d391f5d32a1e0094ca1176fed6940683f56643d073225a0ba5a6258cab6bb9578543d118437c
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
# Cent
|
2
1
|
[![Code Climate](https://codeclimate.com/github/centrifugal/centrifuge-ruby/badges/gpa.svg)](https://codeclimate.com/github/centrifugal/centrifuge-ruby)
|
3
2
|
![Build Status](https://github.com/centrifugal/rubycent/actions/workflows/main.yml/badge.svg)
|
4
3
|
|
5
|
-
[Centrifugo HTTP API
|
4
|
+
[Centrifugo HTTP API](https://centrifugal.dev/docs/server/server_api) client in Ruby.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -100,7 +99,7 @@ end
|
|
100
99
|
|
101
100
|
Send data to the channel.
|
102
101
|
|
103
|
-
[
|
102
|
+
[publish](https://centrifugal.dev/docs/server/server_api#publish)
|
104
103
|
|
105
104
|
```ruby
|
106
105
|
client.publish(channel: 'chat', data: 'hello') # => {}
|
@@ -110,7 +109,7 @@ client.publish(channel: 'chat', data: 'hello') # => {}
|
|
110
109
|
|
111
110
|
Sends data to multiple channels.
|
112
111
|
|
113
|
-
[
|
112
|
+
[broadcast](https://centrifugal.dev/docs/server/server_api#broadcast)
|
114
113
|
|
115
114
|
```ruby
|
116
115
|
client.broadcast(channels: ["clients", "staff"], data: 'hello') # => {}
|
@@ -120,7 +119,7 @@ client.broadcast(channels: ["clients", "staff"], data: 'hello') # => {}
|
|
120
119
|
|
121
120
|
Unsubscribe user from channel. Receives to arguments: channel and user (user ID you want to unsubscribe)
|
122
121
|
|
123
|
-
[
|
122
|
+
[unsubscribe](https://centrifugal.dev/docs/server/server_api#unsubscribe)
|
124
123
|
|
125
124
|
```ruby
|
126
125
|
client.unsubscribe(channel: 'chat', user: '1') # => {}
|
@@ -130,7 +129,7 @@ client.unsubscribe(channel: 'chat', user: '1') # => {}
|
|
130
129
|
|
131
130
|
Allows to disconnect user by it's ID. Receives user ID as an argument.
|
132
131
|
|
133
|
-
[
|
132
|
+
[disconnect](https://centrifugal.dev/docs/server/server_api#disconnect)
|
134
133
|
|
135
134
|
```ruby
|
136
135
|
# Disconnect user with `id = 1`
|
@@ -142,7 +141,7 @@ client.disconnect(user: '1') # => {}
|
|
142
141
|
|
143
142
|
Get channel presence information(all clients currently subscribed on this channel).
|
144
143
|
|
145
|
-
[
|
144
|
+
[presence](https://centrifugal.dev/docs/server/server_api#presence)
|
146
145
|
|
147
146
|
```ruby
|
148
147
|
client.presence(channel: 'chat')
|
@@ -167,7 +166,7 @@ client.presence(channel: 'chat')
|
|
167
166
|
|
168
167
|
Get short channel presence information.
|
169
168
|
|
170
|
-
[
|
169
|
+
[presence_stats](https://centrifugal.dev/docs/server/server_api#presence_stats)
|
171
170
|
|
172
171
|
```ruby
|
173
172
|
client.presence_stats(channel: 'chat')
|
@@ -184,7 +183,7 @@ client.presence_stats(channel: 'chat')
|
|
184
183
|
|
185
184
|
Get channel history information (list of last messages published into channel).
|
186
185
|
|
187
|
-
[
|
186
|
+
[history](https://centrifugal.dev/docs/server/server_api#history)
|
188
187
|
|
189
188
|
```ruby
|
190
189
|
client.history(channel: 'chat')
|
@@ -211,7 +210,7 @@ client.history(channel: 'chat')
|
|
211
210
|
|
212
211
|
Get list of active(with one or more subscribers) channels.
|
213
212
|
|
214
|
-
[
|
213
|
+
[channels](https://centrifugal.dev/docs/server/server_api#channels)
|
215
214
|
|
216
215
|
```ruby
|
217
216
|
client.channels
|
@@ -229,7 +228,7 @@ client.channels
|
|
229
228
|
|
230
229
|
Get running Centrifugo nodes information.
|
231
230
|
|
232
|
-
[
|
231
|
+
[info](https://centrifugal.dev/docs/server/server_api#info)
|
233
232
|
|
234
233
|
```ruby
|
235
234
|
client.info
|
data/lib/cent/http.rb
CHANGED
@@ -39,7 +39,7 @@ module Cent
|
|
39
39
|
def post(body: nil)
|
40
40
|
response = connection.post(nil, body)
|
41
41
|
|
42
|
-
raise ResponseError
|
42
|
+
raise ResponseError.new(**response.body['error'].transform_keys(&:to_sym)) if response.body.key?('error')
|
43
43
|
|
44
44
|
response.body
|
45
45
|
end
|
data/lib/cent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Prikhodko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|