pubnub 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pubnub might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.pubnub.yml +8 -1
- data/CHANGELOG.md +102 -99
- data/Gemfile.lock +1 -1
- data/README.md +34 -34
- data/VERSION +2 -1
- data/fixtures/vcr_cassettes/examples/message_counts/1.yml +15 -10
- data/fixtures/vcr_cassettes/examples/message_counts/2.yml +51 -0
- data/fixtures/vcr_cassettes/examples/message_counts/3.yml +51 -0
- data/fixtures/vcr_cassettes/examples/message_counts/4.yml +48 -0
- data/lib/pubnub/events/message_counts.rb +1 -1
- data/lib/pubnub/validators/message_counts.rb +2 -2
- data/lib/pubnub/version.rb +1 -1
- data/spec/lib/events/message_counts_spec.rb +55 -10
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da9ad5e2ce01753fef0366bfe1fc6c4c1d5c1ecd83701109b8818692cb60de27
|
4
|
+
data.tar.gz: f3936f0f4692c30264d7b126ac8e07b98394ef9da0c31d911fef33693fb82961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 887b3fae6d3d7c351b7ff85cc7abd9aa4a53013f8a2792c03e1285098f3d1fdcd8956d6167f13e66ff2930bc9334653d4536f5784c4573a0cd3aa6790e514ea8
|
7
|
+
data.tar.gz: 9acdeb0e68788e985baada0ef8abd34ea465229613995fe27c6045b483929c410707eb9e2357f63b5e081c786318b39364fb4931134734bce192d0274d480c4b
|
data/.pubnub.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,99 +1,102 @@
|
|
1
|
-
##### 4.2.
|
2
|
-
*
|
3
|
-
|
4
|
-
##### 4.2.
|
5
|
-
*
|
6
|
-
|
7
|
-
##### 4.
|
8
|
-
* Added
|
9
|
-
|
10
|
-
##### 4.1.
|
11
|
-
*
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
*
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
##### 4.0.
|
22
|
-
* Added
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
*
|
27
|
-
|
28
|
-
##### 4.0.
|
29
|
-
* Fixed
|
30
|
-
|
31
|
-
##### 4.0.
|
32
|
-
* Fixed signature generation
|
33
|
-
|
34
|
-
##### 4.0.
|
35
|
-
*
|
36
|
-
|
37
|
-
##### 4.0.
|
38
|
-
*
|
39
|
-
|
40
|
-
##### 4.0.
|
41
|
-
* Fixed
|
42
|
-
|
43
|
-
##### 4.0.
|
44
|
-
* Fixed
|
45
|
-
|
46
|
-
##### 4.0.
|
47
|
-
*
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
* Added
|
52
|
-
|
53
|
-
##### 4.0.
|
54
|
-
* Added
|
55
|
-
|
56
|
-
##### 4.0.
|
57
|
-
*
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
*
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
* Updated
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
*
|
70
|
-
|
71
|
-
##### 4.0.
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
*
|
78
|
-
|
79
|
-
##### 4.0.
|
80
|
-
*
|
81
|
-
|
82
|
-
##### 4.0.
|
83
|
-
*
|
84
|
-
|
85
|
-
##### 4.0.
|
86
|
-
*
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
*
|
91
|
-
|
92
|
-
##### 3.8.
|
93
|
-
*
|
94
|
-
|
95
|
-
##### 3.8.
|
96
|
-
*
|
97
|
-
|
98
|
-
##### 3.8.
|
99
|
-
*
|
1
|
+
##### 4.2.2
|
2
|
+
* Resolved issue with multiple timetokens in message counts endpoint
|
3
|
+
|
4
|
+
##### 4.2.1
|
5
|
+
* Updated listener methods
|
6
|
+
|
7
|
+
##### 4.2.0
|
8
|
+
* Added objects feature
|
9
|
+
|
10
|
+
##### 4.1.6
|
11
|
+
* Added signal feature
|
12
|
+
|
13
|
+
##### 4.1.5
|
14
|
+
* Update dependency dry-validation
|
15
|
+
* Includes minimum Ruby version requirement of 2.4+
|
16
|
+
|
17
|
+
##### 4.0.28
|
18
|
+
* Added Concurrent-ruby Gem
|
19
|
+
* Removed Celluloid
|
20
|
+
|
21
|
+
##### 4.0.25
|
22
|
+
* Added Telemetry
|
23
|
+
|
24
|
+
##### 4.0.24
|
25
|
+
* Added #delete_messages method
|
26
|
+
* Improved timeout error handling (thanks @f1sherman)
|
27
|
+
|
28
|
+
##### 4.0.23
|
29
|
+
* Fixed HereNow envelope generation
|
30
|
+
|
31
|
+
##### 4.0.22
|
32
|
+
* Fixed signature generation and channel name escaping
|
33
|
+
|
34
|
+
##### 4.0.21
|
35
|
+
* Fixed signature generation
|
36
|
+
|
37
|
+
##### 4.0.20
|
38
|
+
* Allowing using multiple cipher keys
|
39
|
+
|
40
|
+
##### 4.0.19
|
41
|
+
* Fixed sync subscribe.
|
42
|
+
|
43
|
+
##### 4.0.16
|
44
|
+
* Fixed missing channel group parameter in Leave event
|
45
|
+
|
46
|
+
##### 4.0.15
|
47
|
+
* Fixed PAM signature when some special characters are present
|
48
|
+
|
49
|
+
##### 4.0.13
|
50
|
+
* Changed init message log level to debug
|
51
|
+
* Added ttl parameter for publish
|
52
|
+
|
53
|
+
##### 4.0.12
|
54
|
+
* Added alert on catchup failure (REQUEST_MESSAGE_COUNT_EXCEEDED)
|
55
|
+
|
56
|
+
##### 4.0.11
|
57
|
+
* Added super admin mode (Enabled when secret key is set on Pubnub::Client init)
|
58
|
+
|
59
|
+
##### 4.0.10
|
60
|
+
* Better single events timeout handling
|
61
|
+
* DRYed envelope formatting a bit
|
62
|
+
|
63
|
+
##### 4.0.9
|
64
|
+
* Removed json dependency
|
65
|
+
* Updated dependecies
|
66
|
+
|
67
|
+
##### 4.0.8
|
68
|
+
* Updated dry-validation
|
69
|
+
* Dropped support for ruby 2.0
|
70
|
+
|
71
|
+
##### 4.0.7
|
72
|
+
* Added message decrypting in history
|
73
|
+
|
74
|
+
##### 4.0.6
|
75
|
+
* channel and channels are the same argument
|
76
|
+
* channel_group and channel_groups are the same argument
|
77
|
+
* added `with_presence` flag for subscibe, default false.
|
78
|
+
|
79
|
+
##### 4.0.5
|
80
|
+
* Required CGI
|
81
|
+
|
82
|
+
##### 4.0.2
|
83
|
+
* Added #subscribe_filter for client
|
84
|
+
|
85
|
+
##### 4.0.1
|
86
|
+
* Updated dry-validation and EnvelopeSchema
|
87
|
+
|
88
|
+
##### 4.0.0
|
89
|
+
* Removed auth_key and uuid setters (#set_auth_key, #auth_key=, #set_uuid, #uuid=)
|
90
|
+
* Added #subscribed_to, #current_region, #region=, #current_heartbeat
|
91
|
+
|
92
|
+
##### 3.8.3
|
93
|
+
* Restored auth_key and uuid setters. Important notice: they will be removed in v4 of this library.
|
94
|
+
|
95
|
+
##### 3.8.2
|
96
|
+
* Added :include_token parameter to history call.
|
97
|
+
|
98
|
+
##### 3.8.1
|
99
|
+
* Updated celluloid dependency.
|
100
|
+
|
101
|
+
##### 3.8.0
|
102
|
+
* Release of celluloid version of pubnub gem. It's complete rewrite but public API doesn't change.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b744287bb0324e2883f95525b12cf19f)](https://www.codacy.com/app/blazeroot/ruby?utm_source=github.com&utm_medium=referral&utm_content=pubnub/ruby&utm_campaign=badger)
|
2
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b744287bb0324e2883f95525b12cf19f)](https://www.codacy.com/app/blazeroot/ruby?utm_source=github.com&utm_medium=referral&utm_content=pubnub/ruby&utm_campaign=Badge_Coverage)
|
3
|
-
[![Build Status](https://travis-ci.org/pubnub/ruby.svg?branch=master)](https://travis-ci.org/pubnub/ruby)
|
4
|
-
|
5
|
-
# Please direct all Support Questions and Concerns to Support@PubNub.com
|
6
|
-
|
7
|
-
# Complete Documentation
|
8
|
-
Available at https://www.pubnub.com/docs/ruby/pubnub-ruby-sdk-v4 **v4.x**
|
9
|
-
|
10
|
-
## PubNub Gem version 4.2.
|
11
|
-
|
12
|
-
##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API.
|
13
|
-
##### http://www.pubnub.com/account
|
14
|
-
|
15
|
-
www.pubnub.com - PubNub Real-time Push Service in the Cloud.
|
16
|
-
|
17
|
-
|
18
|
-
The PubNub Network is a blazingly fast Global Messaging Service for building real-time web and mobile apps. Thousands of apps and developers rely on PubNub for delivering human-perceptive real-time experiences that scale to millions of users worldwide. PubNub delivers the infrastructure needed to build amazing Mobile, MMO games, social apps, business collaborative solutions, and more.
|
19
|
-
|
20
|
-
### Upgrading from PubNub 3.6.x / 3.7.x
|
21
|
-
|
22
|
-
Main change is that we're no longer using EventMachine. Right now Celluloid is used. Public API remain unchanged.
|
23
|
-
If you encounter any issues while upgrading from EventMachine version, please contact us at support@pubnub.com you can also find eventmachine version in "eventmachine" branch of this repo.
|
24
|
-
|
25
|
-
### Upgrading from PubNub 3.5.x
|
26
|
-
|
27
|
-
We've made the response format compatible across all operations. This may break existing parsing of where_now, leave, state, and PAM responses. So if you are monitoring these operation responses, please be sure to modify your code accordingly.
|
28
|
-
|
29
|
-
Examples of affected operations can be found [here](3.5_to_3.6_upgrade_notes.md).
|
30
|
-
|
31
|
-
### Upgrading from PubNub 3.3.x and Earlier
|
32
|
-
PubNub 3.7.3 is NOT compatible with earlier than 3.4 versions of Pubnub Ruby Client.
|
33
|
-
|
34
|
-
# Please direct all Support Questions and Concerns to Support@PubNub.com
|
1
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b744287bb0324e2883f95525b12cf19f)](https://www.codacy.com/app/blazeroot/ruby?utm_source=github.com&utm_medium=referral&utm_content=pubnub/ruby&utm_campaign=badger)
|
2
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b744287bb0324e2883f95525b12cf19f)](https://www.codacy.com/app/blazeroot/ruby?utm_source=github.com&utm_medium=referral&utm_content=pubnub/ruby&utm_campaign=Badge_Coverage)
|
3
|
+
[![Build Status](https://travis-ci.org/pubnub/ruby.svg?branch=master)](https://travis-ci.org/pubnub/ruby)
|
4
|
+
|
5
|
+
# Please direct all Support Questions and Concerns to Support@PubNub.com
|
6
|
+
|
7
|
+
# Complete Documentation
|
8
|
+
Available at https://www.pubnub.com/docs/ruby/pubnub-ruby-sdk-v4 **v4.x**
|
9
|
+
|
10
|
+
## PubNub Gem version 4.2.2
|
11
|
+
|
12
|
+
##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API.
|
13
|
+
##### http://www.pubnub.com/account
|
14
|
+
|
15
|
+
www.pubnub.com - PubNub Real-time Push Service in the Cloud.
|
16
|
+
|
17
|
+
|
18
|
+
The PubNub Network is a blazingly fast Global Messaging Service for building real-time web and mobile apps. Thousands of apps and developers rely on PubNub for delivering human-perceptive real-time experiences that scale to millions of users worldwide. PubNub delivers the infrastructure needed to build amazing Mobile, MMO games, social apps, business collaborative solutions, and more.
|
19
|
+
|
20
|
+
### Upgrading from PubNub 3.6.x / 3.7.x
|
21
|
+
|
22
|
+
Main change is that we're no longer using EventMachine. Right now Celluloid is used. Public API remain unchanged.
|
23
|
+
If you encounter any issues while upgrading from EventMachine version, please contact us at support@pubnub.com you can also find eventmachine version in "eventmachine" branch of this repo.
|
24
|
+
|
25
|
+
### Upgrading from PubNub 3.5.x
|
26
|
+
|
27
|
+
We've made the response format compatible across all operations. This may break existing parsing of where_now, leave, state, and PAM responses. So if you are monitoring these operation responses, please be sure to modify your code accordingly.
|
28
|
+
|
29
|
+
Examples of affected operations can be found [here](3.5_to_3.6_upgrade_notes.md).
|
30
|
+
|
31
|
+
### Upgrading from PubNub 3.3.x and Earlier
|
32
|
+
PubNub 3.7.3 is NOT compatible with earlier than 3.4 versions of Pubnub Ruby Client.
|
33
|
+
|
34
|
+
# Please direct all Support Questions and Concerns to Support@PubNub.com
|
data/VERSION
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
4.2.
|
1
|
+
4.2.2
|
2
|
+
|
@@ -2,28 +2,28 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://
|
5
|
+
uri: http://ps.pndsn.com/v3/history/sub-key/demo/message-counts/a,b,c,d?auth=ruby-test-auth-client-one&pnsdk=PubNub-Ruby/4.2.1&timetoken=12123&uuid=ruby-test-uuid-client-one
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- HTTPClient/1.0 (2.8.3, ruby 2.4.
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
|
12
12
|
Accept:
|
13
13
|
- "*/*"
|
14
14
|
Date:
|
15
|
-
-
|
15
|
+
- Mon, 11 Nov 2019 18:46:26 GMT
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
19
19
|
message: OK
|
20
20
|
headers:
|
21
21
|
Date:
|
22
|
-
-
|
22
|
+
- Mon, 11 Nov 2019 18:46:28 GMT
|
23
23
|
Content-Type:
|
24
24
|
- text/javascript; charset="UTF-8"
|
25
25
|
Content-Length:
|
26
|
-
- '
|
26
|
+
- '473'
|
27
27
|
Connection:
|
28
28
|
- keep-alive
|
29
29
|
Cache-Control:
|
@@ -31,7 +31,7 @@ http_interactions:
|
|
31
31
|
Access-Control-Allow-Origin:
|
32
32
|
- "*"
|
33
33
|
Access-Control-Allow-Methods:
|
34
|
-
- GET, DELETE, OPTIONS
|
34
|
+
- GET, POST, DELETE, OPTIONS
|
35
35
|
Accept-Ranges:
|
36
36
|
- bytes
|
37
37
|
Age:
|
@@ -40,7 +40,12 @@ http_interactions:
|
|
40
40
|
- Pubnub
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string: '{"status": 200, "error": false, "error_message": "", "channels": {"a":0,"c":0,"b":
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
string: '{"status": 200, "error": false, "error_message": "", "channels": {"a":0,"c":0,"b":0,"d":0},
|
44
|
+
"more": {"a": {"url": "/v3/history/sub-key/demo/message-counts/a?timetoken=12123",
|
45
|
+
"is_more": false}, "c": {"url": "/v3/history/sub-key/demo/message-counts/c?timetoken=12123",
|
46
|
+
"is_more": false}, "b": {"url": "/v3/history/sub-key/demo/message-counts/b?timetoken=12123",
|
47
|
+
"is_more": false}, "d": {"url": "/v3/history/sub-key/demo/message-counts/d?timetoken=12123",
|
48
|
+
"is_more": false}}}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Mon, 11 Nov 2019 18:46:26 GMT
|
51
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v3/history/sub-key/demo/message-counts/a,b,c,d?auth=ruby-test-auth-client-one&pnsdk=PubNub-Ruby/4.2.1&timetoken=12123&uuid=ruby-test-uuid-client-one
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Mon, 11 Nov 2019 18:46:26 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Mon, 11 Nov 2019 18:46:28 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '473'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET, POST, DELETE, OPTIONS
|
35
|
+
Accept-Ranges:
|
36
|
+
- bytes
|
37
|
+
Age:
|
38
|
+
- '0'
|
39
|
+
Server:
|
40
|
+
- Pubnub
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"status": 200, "error": false, "error_message": "", "channels": {"a":0,"c":0,"b":0,"d":0},
|
44
|
+
"more": {"a": {"url": "/v3/history/sub-key/demo/message-counts/a?timetoken=12123",
|
45
|
+
"is_more": false}, "c": {"url": "/v3/history/sub-key/demo/message-counts/c?timetoken=12123",
|
46
|
+
"is_more": false}, "b": {"url": "/v3/history/sub-key/demo/message-counts/b?timetoken=12123",
|
47
|
+
"is_more": false}, "d": {"url": "/v3/history/sub-key/demo/message-counts/d?timetoken=12123",
|
48
|
+
"is_more": false}}}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Mon, 11 Nov 2019 18:46:26 GMT
|
51
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v3/history/sub-key/demo/message-counts/a,b,c,d?auth=ruby-test-auth-client-one&channelsTimetoken=1231231254,1231231354,1231231454,1231231654&pnsdk=PubNub-Ruby/4.2.1&uuid=ruby-test-uuid-client-one
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Mon, 11 Nov 2019 18:46:26 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Mon, 11 Nov 2019 18:46:28 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '493'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET, POST, DELETE, OPTIONS
|
35
|
+
Accept-Ranges:
|
36
|
+
- bytes
|
37
|
+
Age:
|
38
|
+
- '0'
|
39
|
+
Server:
|
40
|
+
- Pubnub
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"status": 200, "error": false, "error_message": "", "channels": {"a":0,"c":0,"b":0,"d":0},
|
44
|
+
"more": {"a": {"url": "/v3/history/sub-key/demo/message-counts/a?timetoken=1231231254",
|
45
|
+
"is_more": false}, "c": {"url": "/v3/history/sub-key/demo/message-counts/c?timetoken=1231231454",
|
46
|
+
"is_more": false}, "b": {"url": "/v3/history/sub-key/demo/message-counts/b?timetoken=1231231354",
|
47
|
+
"is_more": false}, "d": {"url": "/v3/history/sub-key/demo/message-counts/d?timetoken=1231231654",
|
48
|
+
"is_more": false}}}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Mon, 11 Nov 2019 18:46:26 GMT
|
51
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v3/history/sub-key/demo/message-counts/a?auth=ruby-test-auth-client-one&pnsdk=PubNub-Ruby/4.2.1&timetoken=1231231254&uuid=ruby-test-uuid-client-one
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Mon, 11 Nov 2019 18:46:26 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Mon, 11 Nov 2019 18:46:28 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '181'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET, POST, DELETE, OPTIONS
|
35
|
+
Accept-Ranges:
|
36
|
+
- bytes
|
37
|
+
Age:
|
38
|
+
- '0'
|
39
|
+
Server:
|
40
|
+
- Pubnub
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"status": 200, "error": false, "error_message": "", "channels": {"a":0},
|
44
|
+
"more": {"a": {"url": "/v3/history/sub-key/demo/message-counts/a?timetoken=1231231254",
|
45
|
+
"is_more": false}}}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 11 Nov 2019 18:46:27 GMT
|
48
|
+
recorded_with: VCR 5.0.0
|
@@ -15,8 +15,8 @@ module Pubnub
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def validate_channel!
|
18
|
-
chans = @
|
19
|
-
chans = @
|
18
|
+
chans = @channel
|
19
|
+
chans = @channel.split(',') if @channel.is_a? String
|
20
20
|
tokens = @timetokens
|
21
21
|
|
22
22
|
if tokens.length.zero?
|
data/lib/pubnub/version.rb
CHANGED
@@ -45,20 +45,65 @@ describe Pubnub::Presence do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'integration test' do
|
48
|
-
|
49
|
-
|
48
|
+
|
49
|
+
it 'returns valid response with multiple channels as array and single timetoken' do
|
50
|
+
VCR.use_cassette('examples/message_counts/1', record: :once) do
|
51
|
+
pubnub = Pubnub.new(
|
52
|
+
publish_key: 'demo',
|
53
|
+
subscribe_key: 'demo',
|
54
|
+
uuid: 'ruby-test-uuid-client-one',
|
55
|
+
auth_key: 'ruby-test-auth-client-one'
|
56
|
+
)
|
57
|
+
envelope = pubnub.message_counts(channel:['a','b','c','d'], channel_timetokens: 12123).value
|
58
|
+
res = envelope.result[:data]
|
59
|
+
expect(res.keys).to contain_exactly("channels", "error", "error_message", "more", "status")
|
60
|
+
expect(res["channels"].keys).to contain_exactly("a", "b", "c", "d")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'returns valid response with multiple channels as string and single timetoken' do
|
65
|
+
VCR.use_cassette('examples/message_counts/2', record: :once) do
|
66
|
+
pubnub = Pubnub.new(
|
67
|
+
publish_key: 'demo',
|
68
|
+
subscribe_key: 'demo',
|
69
|
+
uuid: 'ruby-test-uuid-client-one',
|
70
|
+
auth_key: 'ruby-test-auth-client-one'
|
71
|
+
)
|
72
|
+
envelope = pubnub.message_counts(channel:'a,b,c,d', channel_timetokens: 12123).value
|
73
|
+
res = envelope.result[:data]
|
74
|
+
expect(res.keys).to contain_exactly("channels", "error", "error_message", "more", "status")
|
75
|
+
expect(res["channels"].keys).to contain_exactly("a", "b", "c", "d")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'returns valid response with multiple channels as array and multiple timetokens' do
|
80
|
+
VCR.use_cassette('examples/message_counts/3', record: :once) do
|
50
81
|
pubnub = Pubnub.new(
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
envelope = pubnub.message_counts(channel:['a,b,c,d'], channel_timetokens: 12123).value
|
82
|
+
publish_key: 'demo',
|
83
|
+
subscribe_key: 'demo',
|
84
|
+
uuid: 'ruby-test-uuid-client-one',
|
85
|
+
auth_key: 'ruby-test-auth-client-one'
|
86
|
+
)
|
87
|
+
envelope = pubnub.message_counts(channel:['a','b','c','d'], channel_timetokens: [1231231254, 1231231354, 1231231454, 1231231654]).value
|
58
88
|
res = envelope.result[:data]
|
59
|
-
expect(res.keys).to contain_exactly("channels", "error", "error_message", "status")
|
89
|
+
expect(res.keys).to contain_exactly("channels", "error", "error_message", "more", "status")
|
60
90
|
expect(res["channels"].keys).to contain_exactly("a", "b", "c", "d")
|
61
91
|
end
|
62
92
|
end
|
93
|
+
|
94
|
+
it 'returns valid response with single channel as string and multiple timetokens' do
|
95
|
+
VCR.use_cassette('examples/message_counts/4', record: :once) do
|
96
|
+
pubnub = Pubnub.new(
|
97
|
+
publish_key: 'demo',
|
98
|
+
subscribe_key: 'demo',
|
99
|
+
uuid: 'ruby-test-uuid-client-one',
|
100
|
+
auth_key: 'ruby-test-auth-client-one'
|
101
|
+
)
|
102
|
+
envelope = pubnub.message_counts(channel:'a', channel_timetokens: 1231231254).value
|
103
|
+
res = envelope.result[:data]
|
104
|
+
expect(res.keys).to contain_exactly("channels", "error", "error_message", "more", "status")
|
105
|
+
expect(res["channels"].keys).to contain_exactly("a")
|
106
|
+
end
|
107
|
+
end
|
63
108
|
end
|
64
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubnub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PubNub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -3864,6 +3864,9 @@ files:
|
|
3864
3864
|
- fixtures/vcr_cassettes/examples/leave/8.yml
|
3865
3865
|
- fixtures/vcr_cassettes/examples/leave/9.yml
|
3866
3866
|
- fixtures/vcr_cassettes/examples/message_counts/1.yml
|
3867
|
+
- fixtures/vcr_cassettes/examples/message_counts/2.yml
|
3868
|
+
- fixtures/vcr_cassettes/examples/message_counts/3.yml
|
3869
|
+
- fixtures/vcr_cassettes/examples/message_counts/4.yml
|
3867
3870
|
- fixtures/vcr_cassettes/examples/presence/0.yml
|
3868
3871
|
- fixtures/vcr_cassettes/examples/presence/1.yml
|
3869
3872
|
- fixtures/vcr_cassettes/examples/presence/10.yml
|