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 +4 -4
- data/lib/posthog/field_parser.rb +12 -3
- data/lib/posthog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4e71138d169f5c226e194b90e5a0d9e0243389eb98bd32e9da67b2b5bf45c57
|
4
|
+
data.tar.gz: c814fc65c03770c4ac056b4ab74d0b39efb268e1b7b778a29d06120158b20533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b8950767de513e3aeae1487b7eacf1e272af98689d6906d1e04837c4bd8a7b7e7aba4c9cdb2d5eae8503b7e83d7d7e0c59e0d9952076da769500abb8839d51f
|
7
|
+
data.tar.gz: 7ce785b37aeda279b27b8fde71592561c8854133a91a70f316b415487e601bd5646cb857b909c473eb30fd8767a50678b9c2ba5b43041827b1232775ccd2efe6
|
data/lib/posthog/field_parser.rb
CHANGED
@@ -31,7 +31,7 @@ module PostHog
|
|
31
31
|
|
32
32
|
isoify_dates! properties
|
33
33
|
|
34
|
-
common['uuid'] = uuid if
|
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
|
-
|
178
|
-
|
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
|
data/lib/posthog/version.rb
CHANGED