cent 2.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +5 -3
- data/.github/workflows/release.yml +8 -5
- data/CHANGELOG.md +10 -0
- data/LICENSE.txt +1 -1
- data/README.md +10 -11
- data/cent.gemspec +2 -4
- data/lib/cent/client.rb +0 -1
- data/lib/cent/http.rb +2 -2
- data/lib/cent/version.rb +1 -1
- metadata +16 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fadf11a9b2cdfa2b9c490e59adbf052515c9a0c4f5091405ffd3bca4f345bfb
|
4
|
+
data.tar.gz: 07e0c29ede9d249c0d8b36d3d432a37fa8048c82e54c7540b8ef67131b103d76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f99f6ab6178fda5cce7adcac441e35313c2c2990fcfedbf685ddbfd4fc2c70bcd1098231c3ee1580b39154cca836ef590d05a8ac5032e8ca8946e16666ab6716
|
7
|
+
data.tar.gz: 6158ba6dc6ccd667b206f2d50ce7c7a832412bf5360686de0f0c8948df219c8a84d5d273a31fcaeb819e4474580a554eb40545e5512628a2eee445c7e5cba9b9
|
data/.github/workflows/main.yml
CHANGED
@@ -5,14 +5,16 @@ on: [push,pull_request]
|
|
5
5
|
jobs:
|
6
6
|
build:
|
7
7
|
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby-version: ['2.7', '3.3']
|
8
11
|
steps:
|
9
|
-
- uses: actions/checkout@
|
12
|
+
- uses: actions/checkout@v4
|
10
13
|
- name: Set up Ruby
|
11
14
|
uses: ruby/setup-ruby@v1
|
12
15
|
with:
|
13
|
-
ruby-version:
|
16
|
+
ruby-version: ${{ matrix.ruby-version }}
|
14
17
|
- name: Run the default task
|
15
18
|
run: |
|
16
|
-
gem install bundler -v 2.2.10
|
17
19
|
bundle install
|
18
20
|
bundle exec rake
|
@@ -14,13 +14,16 @@ jobs:
|
|
14
14
|
|
15
15
|
steps:
|
16
16
|
- name: Checkout
|
17
|
-
uses: actions/checkout@
|
17
|
+
uses: actions/checkout@v4
|
18
18
|
|
19
|
-
- name: Set up Ruby
|
20
|
-
uses: ruby/setup-ruby@
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
21
|
with:
|
22
|
-
ruby-version:
|
23
|
-
|
22
|
+
ruby-version: 3.3.0
|
23
|
+
|
24
|
+
- name: Bundle install
|
25
|
+
run: |
|
26
|
+
bundle install
|
24
27
|
|
25
28
|
- name: Publish to RubyGems
|
26
29
|
run: |
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
3.0.0
|
2
|
+
=====
|
3
|
+
|
4
|
+
Not using changelog anymore. See [Github releases](https://github.com/centrifugal/rubycent/releases) now.
|
5
|
+
|
6
|
+
2.2.0
|
7
|
+
=====
|
8
|
+
|
9
|
+
* Fix `ArgumentError: wrong number of arguments` when creating `ResponseError` in Ruby 3, [#21](https://github.com/centrifugal/rubycent/pull/21)
|
10
|
+
|
1
11
|
2.1.0
|
2
12
|
=====
|
3
13
|
|
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/cent.gemspec
CHANGED
@@ -30,8 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
|
31
31
|
spec.require_paths = ['lib']
|
32
32
|
|
33
|
-
spec.add_dependency 'faraday', '<3.0.0', '>
|
34
|
-
|
35
|
-
spec.add_dependency 'faraday_middleware', '<2.0.0', '~> 1.0'
|
36
|
-
spec.add_dependency 'jwt', '~> 2.2'
|
33
|
+
spec.add_dependency 'faraday', '<3.0.0', '> 2.0.0'
|
34
|
+
spec.add_dependency 'jwt', '<3.0.0', '> 2.2.0'
|
37
35
|
end
|
data/lib/cent/client.rb
CHANGED
data/lib/cent/http.rb
CHANGED
@@ -12,7 +12,7 @@ module Cent
|
|
12
12
|
|
13
13
|
def initialize(code:, message:)
|
14
14
|
@code = code
|
15
|
-
super
|
15
|
+
super(message)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -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,69 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.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: 2024-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ">"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0
|
20
17
|
- - "<"
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 3.0.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
20
|
- - ">"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.0
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 3.0.0
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: faraday_middleware
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '1.0'
|
40
|
-
- - "<"
|
41
21
|
- !ruby/object:Gem::Version
|
42
22
|
version: 2.0.0
|
43
23
|
type: :runtime
|
44
24
|
prerelease: false
|
45
25
|
version_requirements: !ruby/object:Gem::Requirement
|
46
26
|
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '1.0'
|
50
27
|
- - "<"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.0
|
30
|
+
- - ">"
|
51
31
|
- !ruby/object:Gem::Version
|
52
32
|
version: 2.0.0
|
53
33
|
- !ruby/object:Gem::Dependency
|
54
34
|
name: jwt
|
55
35
|
requirement: !ruby/object:Gem::Requirement
|
56
36
|
requirements:
|
57
|
-
- - "
|
37
|
+
- - "<"
|
58
38
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
39
|
+
version: 3.0.0
|
40
|
+
- - ">"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.2.0
|
60
43
|
type: :runtime
|
61
44
|
prerelease: false
|
62
45
|
version_requirements: !ruby/object:Gem::Requirement
|
63
46
|
requirements:
|
64
|
-
- - "
|
47
|
+
- - "<"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 3.0.0
|
50
|
+
- - ">"
|
65
51
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
52
|
+
version: 2.2.0
|
67
53
|
description: |
|
68
54
|
Provides helper classes Cent::Client and Cent::Notary.
|
69
55
|
|
@@ -115,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
101
|
- !ruby/object:Gem::Version
|
116
102
|
version: '0'
|
117
103
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
104
|
+
rubygems_version: 3.5.3
|
119
105
|
signing_key:
|
120
106
|
specification_version: 4
|
121
107
|
summary: Centrifugo API V2 Ruby Client
|