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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f831ff43edccdc424ceea6408dae5d704d30c35fccb7e496d4e328a884169b6
4
- data.tar.gz: c12621f317beac91d53b3008a5ba32a02557aff54e998f1b6e8ff3c27c2e88c0
3
+ metadata.gz: 94a5346f9874553c5abf72a14cd22f76fe14d268c81ac97e8c88c8489fba2bf4
4
+ data.tar.gz: 9c6517348ed1e98f0434105afadacbb3b1d381437edb996366d977ec9749ba53
5
5
  SHA512:
6
- metadata.gz: 7d575ef625dcdbc6fd15158740f557cc8914789de48ecfa6885e25c6d35ca86d7fa3bb09a1e85d871e5ae734e52ca8df5b96a85579be7bb784803d47dfb1d503
7
- data.tar.gz: 2ec1515df9563f963bf3bfe664e8e4911a8737e72dbe44dde7d161008f11b3684d19e7c0e05bbd1dab6d2941fd8f442652bf16fe2fbe7b068b404a08bd7cc100
6
+ metadata.gz: d16f505c9f0bddfb93e794abefe02f7e4c23e23158e755c97a942b27fae298d8c244d1e6cc1bae6d9ef439f5cc631354a50d401f419da2a0d3ce523474ccc737
7
+ data.tar.gz: cdab28581565cadc69597cc737b4fe616296e43f5c686a58543312d37fec6f8b4dd377d3fc26406a404e6791a4ba731bfe25cc8a5f899b1c5e054759286fcd4d
data/.pubnub.yml CHANGED
@@ -1,6 +1,11 @@
1
1
  ---
2
- version: "4.8.0"
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-4.8.0.gem
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-4.8.0.gem
730
- location: https://github.com/pubnub/ruby/releases/download/v4.8.0/pubnub-4.8.0.gem
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
@@ -1,3 +1,9 @@
1
+ ## v5.0.0
2
+ January 13 2022
3
+
4
+ #### Modified
5
+ - BREAKING CHANGES: uuid is required parameter to create PubNub instance.
6
+
1
7
  ## v4.8.0
2
8
  December 16 2021
3
9
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pubnub (4.8.0)
4
+ pubnub (5.0.0)
5
5
  addressable (>= 2.0.0)
6
6
  concurrent-ruby (~> 1.1.5)
7
7
  concurrent-ruby-edge (~> 0.5.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.8.0
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|
@@ -11,6 +11,7 @@ module Pubnub
11
11
  validate_origin parameters[:origin], true
12
12
  validate_subscribe_key parameters[:subscribe_key], true
13
13
  validate_publish_key parameters[:publish_key]
14
+ validate_uuid parameters[:uuid]
14
15
  end
15
16
  end
16
17
  end
@@ -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
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '4.8.0'.freeze
3
+ VERSION = '5.0.0'.freeze
4
4
  end
data/lib/pubnub.rb CHANGED
@@ -15,6 +15,7 @@ require 'concurrent-edge'
15
15
 
16
16
  require 'pubnub/version'
17
17
  require 'pubnub/client'
18
+ require 'pubnub/uuid'
18
19
 
19
20
  # Adding blank? and present? methods to Object.
20
21
  class Object
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.8.0
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: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable