pubnub 4.8.0 → 5.0.0
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 +9 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/features/step_definitions/access_steps.rb +2 -0
- data/lib/pubnub/client/getters_setters.rb +5 -0
- data/lib/pubnub/client.rb +0 -5
- data/lib/pubnub/validators/client.rb +1 -0
- data/lib/pubnub/validators/common_validator.rb +17 -0
- data/lib/pubnub/version.rb +1 -1
- data/lib/pubnub.rb +1 -0
- 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: 94a5346f9874553c5abf72a14cd22f76fe14d268c81ac97e8c88c8489fba2bf4
|
4
|
+
data.tar.gz: 9c6517348ed1e98f0434105afadacbb3b1d381437edb996366d977ec9749ba53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d16f505c9f0bddfb93e794abefe02f7e4c23e23158e755c97a942b27fae298d8c244d1e6cc1bae6d9ef439f5cc631354a50d401f419da2a0d3ce523474ccc737
|
7
|
+
data.tar.gz: cdab28581565cadc69597cc737b4fe616296e43f5c686a58543312d37fec6f8b4dd377d3fc26406a404e6791a4ba731bfe25cc8a5f899b1c5e054759286fcd4d
|
data/.pubnub.yml
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
---
|
2
|
-
version: "
|
2
|
+
version: "5.0.0"
|
3
3
|
changelog:
|
4
|
+
- date: 2022-01-13
|
5
|
+
version: v5.0.0
|
6
|
+
changes:
|
7
|
+
- type: improvement
|
8
|
+
text: "BREAKING CHANGES: uuid is required parameter to create PubNub instance."
|
4
9
|
- date: 2021-12-16
|
5
10
|
version: v4.8.0
|
6
11
|
changes:
|
@@ -621,7 +626,7 @@ sdks:
|
|
621
626
|
- x86-64
|
622
627
|
- distribution-type: package
|
623
628
|
distribution-repository: RubyGems
|
624
|
-
package-name: pubnub-
|
629
|
+
package-name: pubnub-5.0.0.gem
|
625
630
|
location: https://rubygems.org/gems/pubnub
|
626
631
|
requires:
|
627
632
|
- name: addressable
|
@@ -726,8 +731,8 @@ sdks:
|
|
726
731
|
- x86-64
|
727
732
|
- distribution-type: library
|
728
733
|
distribution-repository: GitHub release
|
729
|
-
package-name: pubnub-
|
730
|
-
location: https://github.com/pubnub/ruby/releases/download/
|
734
|
+
package-name: pubnub-5.0.0.gem
|
735
|
+
location: https://github.com/pubnub/ruby/releases/download/v5.0.0/pubnub-5.0.0.gem
|
731
736
|
requires:
|
732
737
|
- name: addressable
|
733
738
|
min-version: 2.0.0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
5.0.0
|
@@ -12,6 +12,7 @@ Given('I have a keyset with access manager enabled') do
|
|
12
12
|
logger = Logger.new(STDOUT)
|
13
13
|
logger.level = Logger::DEBUG
|
14
14
|
@pn_configuration['logger'] = logger
|
15
|
+
@pn_configuration['uuid'] = Pubnub::UUID.generate
|
15
16
|
|
16
17
|
@pubnub = Pubnub.new(@pn_configuration)
|
17
18
|
end
|
@@ -24,6 +25,7 @@ Given('I have a keyset with access manager enabled - without secret key') do
|
|
24
25
|
logger = Logger.new(STDOUT)
|
25
26
|
logger.level = Logger::DEBUG
|
26
27
|
@pn_configuration['logger'] = logger
|
28
|
+
@pn_configuration['uuid'] = Pubnub::UUID.generate
|
27
29
|
|
28
30
|
@pubnub = Pubnub.new(@pn_configuration)
|
29
31
|
end
|
@@ -1,9 +1,12 @@
|
|
1
|
+
require 'pubnub/validators/common_validator'
|
2
|
+
|
1
3
|
# Toplevel Pubnub module.
|
2
4
|
module Pubnub
|
3
5
|
# Pubnub client Class
|
4
6
|
class Client
|
5
7
|
# Module that holds some getters and setters
|
6
8
|
module GettersSetters
|
9
|
+
|
7
10
|
def sdk_version
|
8
11
|
"PubNub-Ruby/#{Pubnub::VERSION}"
|
9
12
|
end
|
@@ -25,6 +28,8 @@ module Pubnub
|
|
25
28
|
def change_uuid(uuid)
|
26
29
|
Pubnub.logger.debug('Pubnub::Client') { 'Changing uuid' }
|
27
30
|
raise('Cannot change UUID while subscribed.') if subscribed?
|
31
|
+
Validator::Client.validate_uuid uuid
|
32
|
+
|
28
33
|
@env[:uuid] = uuid
|
29
34
|
end
|
30
35
|
|
data/lib/pubnub/client.rb
CHANGED
@@ -384,14 +384,9 @@ module Pubnub
|
|
384
384
|
|
385
385
|
def prepare_env
|
386
386
|
assign_defaults
|
387
|
-
generate_uuid if @env[:uuid].blank?
|
388
387
|
setup_pools
|
389
388
|
end
|
390
389
|
|
391
|
-
def generate_uuid
|
392
|
-
@env[:uuid] = UUID.generate
|
393
|
-
end
|
394
|
-
|
395
390
|
def assign_defaults
|
396
391
|
@env[:origin] = @env[:origins_pool].first if @env[:origins_pool]
|
397
392
|
default_values.each do |k, v|
|
@@ -52,6 +52,23 @@ module Pubnub
|
|
52
52
|
)
|
53
53
|
end
|
54
54
|
end
|
55
|
+
|
56
|
+
# Validates given uuid
|
57
|
+
def validate_uuid(uuid)
|
58
|
+
if !uuid || uuid.blank?
|
59
|
+
raise(
|
60
|
+
InitializationError.new,
|
61
|
+
'Missing required :uuid parameter.'
|
62
|
+
)
|
63
|
+
elsif !([String, Symbol].include?(uuid.class) ||
|
64
|
+
uuid.blank?)
|
65
|
+
raise(
|
66
|
+
InitializationError.new,
|
67
|
+
'UUID parameter is not valid. \
|
68
|
+
Should be type of String or Symbol.'
|
69
|
+
)
|
70
|
+
end
|
71
|
+
end
|
55
72
|
end
|
56
73
|
end
|
57
74
|
end
|
data/lib/pubnub/version.rb
CHANGED
data/lib/pubnub.rb
CHANGED
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
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PubNub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|