posthog-ruby 3.0.0 → 3.0.1

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: 253c223f00642a02c72d074b6fbf7a523d5799b2a03eed42794e3ab03d6d9c82
4
- data.tar.gz: e6c509257a8b09588a3cfd4081ef79184150d28e1d9d9b41a189364c9758e99a
3
+ metadata.gz: e4e71138d169f5c226e194b90e5a0d9e0243389eb98bd32e9da67b2b5bf45c57
4
+ data.tar.gz: c814fc65c03770c4ac056b4ab74d0b39efb268e1b7b778a29d06120158b20533
5
5
  SHA512:
6
- metadata.gz: 824adb5f3f57fbc404876cf8a3a05736ee1b9d5e42114f5a51cfd6d833a35ddff0a45eb9010aaa2744d1c3ea5e150807a2b05d4e88ed7883d579d9debd71a53f
7
- data.tar.gz: d48f1843633e2a8ff16a5f17a9ada51d431a1219ca91b273e72872e8e6acae2f0d409252247c1ec0b7c165ea11fe844313dbad57f16322de20c0bf53651cf6fb
6
+ metadata.gz: 9b8950767de513e3aeae1487b7eacf1e272af98689d6906d1e04837c4bd8a7b7e7aba4c9cdb2d5eae8503b7e83d7d7e0c59e0d9952076da769500abb8839d51f
7
+ data.tar.gz: 7ce785b37aeda279b27b8fde71592561c8854133a91a70f316b415487e601bd5646cb857b909c473eb30fd8767a50678b9c2ba5b43041827b1232775ccd2efe6
@@ -31,7 +31,7 @@ module PostHog
31
31
 
32
32
  isoify_dates! properties
33
33
 
34
- common['uuid'] = uuid if uuid? uuid
34
+ common['uuid'] = uuid if valid_uuid_for_event_props? uuid
35
35
 
36
36
  common.merge(
37
37
  {
@@ -174,8 +174,17 @@ module PostHog
174
174
  raise ArgumentError, "#{name} must be a Hash" unless obj.is_a? Hash
175
175
  end
176
176
 
177
- def uuid?(uuid)
178
- is_valid_uuid = uuid.match?(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/i) if uuid
177
+ # @param [Object] uuid - the UUID to validate, user provided, so we don't know the type
178
+ # @return [TrueClass, FalseClass] - true if the UUID is valid or absent, false otherwise
179
+ def valid_uuid_for_event_props?(uuid)
180
+ return true if uuid.nil?
181
+
182
+ unless uuid.is_a?(String)
183
+ logger.warn 'UUID is not a string. Ignoring it.'
184
+ return false
185
+ end
186
+
187
+ is_valid_uuid = uuid.match?(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/i)
179
188
  logger.warn "UUID is not valid: #{uuid}. Ignoring it." unless is_valid_uuid
180
189
 
181
190
  is_valid_uuid
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostHog
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posthog-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''