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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e3dd1d474f3a7ccd15e14e8eb931da336c59eec2c483211509ca047f38fbcf1
4
- data.tar.gz: 7e2d24ade1f3c10584580e688ecb3f236d602c461d3b7f9175a9573b0d795c1f
3
+ metadata.gz: da9ad5e2ce01753fef0366bfe1fc6c4c1d5c1ecd83701109b8818692cb60de27
4
+ data.tar.gz: f3936f0f4692c30264d7b126ac8e07b98394ef9da0c31d911fef33693fb82961
5
5
  SHA512:
6
- metadata.gz: 2922e70b04a70cc12e838080e2be8d8d2c85176c9dd9a5cc5542fdc02000d1bc989b9e39e046c0b6ddba9969a9112add60f5622dea50f633a29985bdc7caa22d
7
- data.tar.gz: 1d374d572927336782075f6980391bcde9205916d511457045bc4475e20695b77d86b196894b3210dc6b17654f5760395079ec18dae38d5e8e9f241a702f7a5e
6
+ metadata.gz: 887b3fae6d3d7c351b7ff85cc7abd9aa4a53013f8a2792c03e1285098f3d1fdcd8956d6167f13e66ff2930bc9334653d4536f5784c4573a0cd3aa6790e514ea8
7
+ data.tar.gz: 9acdeb0e68788e985baada0ef8abd34ea465229613995fe27c6045b483929c410707eb9e2357f63b5e081c786318b39364fb4931134734bce192d0274d480c4b
@@ -1,6 +1,13 @@
1
1
  ---
2
- version: "4.2.1"
2
+ version: "4.2.2"
3
3
  changelog:
4
+ -
5
+ changes:
6
+ -
7
+ text: "Resolved issue with multiple timetokens in message counts endpoint"
8
+ type: bugfix
9
+ date: 11-11-2019
10
+ version: "4.2.2"
4
11
  -
5
12
  changes:
6
13
  -
@@ -1,99 +1,102 @@
1
- ##### 4.2.1
2
- * Updated listener methods
3
-
4
- ##### 4.2.0
5
- * Added objects feature
6
-
7
- ##### 4.1.6
8
- * Added signal feature
9
-
10
- ##### 4.1.5
11
- * Update dependency dry-validation
12
- * Includes minimum Ruby version requirement of 2.4+
13
-
14
- ##### 4.0.28
15
- * Added Concurrent-ruby Gem
16
- * Removed Celluloid
17
-
18
- ##### 4.0.25
19
- * Added Telemetry
20
-
21
- ##### 4.0.24
22
- * Added #delete_messages method
23
- * Improved timeout error handling (thanks @f1sherman)
24
-
25
- ##### 4.0.23
26
- * Fixed HereNow envelope generation
27
-
28
- ##### 4.0.22
29
- * Fixed signature generation and channel name escaping
30
-
31
- ##### 4.0.21
32
- * Fixed signature generation
33
-
34
- ##### 4.0.20
35
- * Allowing using multiple cipher keys
36
-
37
- ##### 4.0.19
38
- * Fixed sync subscribe.
39
-
40
- ##### 4.0.16
41
- * Fixed missing channel group parameter in Leave event
42
-
43
- ##### 4.0.15
44
- * Fixed PAM signature when some special characters are present
45
-
46
- ##### 4.0.13
47
- * Changed init message log level to debug
48
- * Added ttl parameter for publish
49
-
50
- ##### 4.0.12
51
- * Added alert on catchup failure (REQUEST_MESSAGE_COUNT_EXCEEDED)
52
-
53
- ##### 4.0.11
54
- * Added super admin mode (Enabled when secret key is set on Pubnub::Client init)
55
-
56
- ##### 4.0.10
57
- * Better single events timeout handling
58
- * DRYed envelope formatting a bit
59
-
60
- ##### 4.0.9
61
- * Removed json dependency
62
- * Updated dependecies
63
-
64
- ##### 4.0.8
65
- * Updated dry-validation
66
- * Dropped support for ruby 2.0
67
-
68
- ##### 4.0.7
69
- * Added message decrypting in history
70
-
71
- ##### 4.0.6
72
- * channel and channels are the same argument
73
- * channel_group and channel_groups are the same argument
74
- * added `with_presence` flag for subscibe, default false.
75
-
76
- ##### 4.0.5
77
- * Required CGI
78
-
79
- ##### 4.0.2
80
- * Added #subscribe_filter for client
81
-
82
- ##### 4.0.1
83
- * Updated dry-validation and EnvelopeSchema
84
-
85
- ##### 4.0.0
86
- * Removed auth_key and uuid setters (#set_auth_key, #auth_key=, #set_uuid, #uuid=)
87
- * Added #subscribed_to, #current_region, #region=, #current_heartbeat
88
-
89
- ##### 3.8.3
90
- * Restored auth_key and uuid setters. Important notice: they will be removed in v4 of this library.
91
-
92
- ##### 3.8.2
93
- * Added :include_token parameter to history call.
94
-
95
- ##### 3.8.1
96
- * Updated celluloid dependency.
97
-
98
- ##### 3.8.0
99
- * Release of celluloid version of pubnub gem. It's complete rewrite but public API doesn't change.
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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pubnub (4.2.1)
4
+ pubnub (4.2.2)
5
5
  concurrent-ruby (~> 1.1.5)
6
6
  concurrent-ruby-edge (~> 0.5.0)
7
7
  dry-validation (~> 1.0)
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.1
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
1
+ 4.2.2
2
+
@@ -2,28 +2,28 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://balancer1g.bronze.aws-pdx-1.ps.pn/v3/history/sub-key/demo-36/message-counts/a,b,c,d?auth=ruby-test-auth-client-one&pnsdk=PubNub-Ruby/4.1.0&timetoken=12123&uuid=ruby-test-uuid-client-one
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.2 (2017-09-14))
11
+ - HTTPClient/1.0 (2.8.3, ruby 2.4.6 (2019-04-01))
12
12
  Accept:
13
13
  - "*/*"
14
14
  Date:
15
- - Wed, 27 Feb 2019 20:08:09 GMT
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
- - Wed, 27 Feb 2019 20:08:09 GMT
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
- - '91'
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":1,"d":0}}'
44
- http_version:
45
- recorded_at: Wed, 27 Feb 2019 20:08:10 GMT
46
- recorded_with: VCR 4.0.0
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
@@ -40,7 +40,7 @@ module Pubnub
40
40
  if @timetokens.length == 1
41
41
  params[:timetoken] = @timetokens.first
42
42
  elsif @timetokens.length > 1
43
- params[:channelTimetokens] = @timetokens.join(',')
43
+ params[:channelsTimetoken] = @timetokens.join(',')
44
44
  end
45
45
  params
46
46
  end
@@ -15,8 +15,8 @@ module Pubnub
15
15
  private
16
16
 
17
17
  def validate_channel!
18
- chans = @channels
19
- chans = @channels.split(',') if @channels.is_a? String
18
+ chans = @channel
19
+ chans = @channel.split(',') if @channel.is_a? String
20
20
  tokens = @timetokens
21
21
 
22
22
  if tokens.length.zero?
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '4.2.1'.freeze
3
+ VERSION = '4.2.2'.freeze
4
4
  end
@@ -45,20 +45,65 @@ describe Pubnub::Presence do
45
45
  end
46
46
 
47
47
  context 'integration test' do
48
- it 'returns valid response' do
49
- VCR.use_cassette('examples/message_counts/1', record: :none) do
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
- publish_key: 'demo-36',
52
- subscribe_key: 'demo-36',
53
- uuid: 'ruby-test-uuid-client-one',
54
- auth_key: 'ruby-test-auth-client-one',
55
- origin: 'balancer1g.bronze.aws-pdx-1.ps.pn'
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.1
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-10-28 00:00:00.000000000 Z
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