cent 2.1.0 → 3.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d177048be5a5c912db6ce130d832d292be71ccefc9098acb787bf5e47a861a6f
4
- data.tar.gz: 995f51e9fd398a341e0397e8da0b958a84dcbce31ed2d0f05913edb0b97925b9
3
+ metadata.gz: 9fadf11a9b2cdfa2b9c490e59adbf052515c9a0c4f5091405ffd3bca4f345bfb
4
+ data.tar.gz: 07e0c29ede9d249c0d8b36d3d432a37fa8048c82e54c7540b8ef67131b103d76
5
5
  SHA512:
6
- metadata.gz: 302bd8e03bbb3d6636385a8a59138dd491c2e586270c93cd3ed777fa90e3b6605502c6d6f6b829f398a735e30d2030e92043d7f69ec17c5bfbcf5f1e30bbba65
7
- data.tar.gz: 3f0e19146b8175a3851048222b0bd490998a2aefb079e9a7d4c74c19125657b72e4103ecd3b15bea5fd83177b28596637141f4a3ddb7796927ddbd601fd81544
6
+ metadata.gz: f99f6ab6178fda5cce7adcac441e35313c2c2990fcfedbf685ddbfd4fc2c70bcd1098231c3ee1580b39154cca836ef590d05a8ac5032e8ca8946e16666ab6716
7
+ data.tar.gz: 6158ba6dc6ccd667b206f2d50ce7c7a832412bf5360686de0f0c8948df219c8a84d5d273a31fcaeb819e4474580a554eb40545e5512628a2eee445c7e5cba9b9
@@ -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@v2
12
+ - uses: actions/checkout@v4
10
13
  - name: Set up Ruby
11
14
  uses: ruby/setup-ruby@v1
12
15
  with:
13
- ruby-version: 2.7.1
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@v2
17
+ uses: actions/checkout@v4
18
18
 
19
- - name: Set up Ruby 2.6
20
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
21
  with:
22
- ruby-version: 2.6
23
- - run: bundle install
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
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Centrifugal
3
+ Copyright (c) 2023 Centrifugal Labs LTD
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 v2](https://centrifugal.github.io/centrifugo/server/http_api/) client in Ruby.
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#publish](https://centrifugal.github.io/centrifugo/server/http_api/#publish)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#broadcast](https://centrifugal.github.io/centrifugo/server/http_api/#broadcast)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#unsubscribe](https://centrifugal.github.io/centrifugo/server/http_api/#unsubscribe)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#disconnect](https://centrifugal.github.io/centrifugo/server/http_api/#disconnect)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#presence](https://centrifugal.github.io/centrifugo/server/http_api/#presence)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#presence_stats](https://centrifugal.github.io/centrifugo/server/http_api/#precence_stats)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#history](https://centrifugal.github.io/centrifugo/server/http_api/#hisotry)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#channels](https://centrifugal.github.io/centrifugo/server/http_api/#channels)
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
- [https://centrifugal.github.io/centrifugo/server/http_api/#info](https://centrifugal.github.io/centrifugo/server/http_api/#info)
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', '> 1.0.0'
34
- # NOTE: Remove `faraday_middleware` after changing `faraday`'s minimum version to `2.0.0`.
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
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'faraday'
4
- require 'faraday_middleware' if Gem::Version.new(Faraday::VERSION) <= Gem::Version.new('2.0.0')
5
4
  require 'cent/http'
6
5
 
7
6
  module Cent
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 message
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, response.body['error'].transform_keys(&:to_sym) if response.body.key?('error')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cent
4
- VERSION = '2.1.0'
4
+ VERSION = '3.0.0'
5
5
  end
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: 2.1.0
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: 2022-09-06 00:00:00.000000000 Z
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: '2.2'
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: '2.2'
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.0.3.1
104
+ rubygems_version: 3.5.3
119
105
  signing_key:
120
106
  specification_version: 4
121
107
  summary: Centrifugo API V2 Ruby Client