posthog-ruby 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b0fe64cbfa7e53a76fdd9241fb1eff4b428babe557ae8ee1ce62c2a287e42a5
4
- data.tar.gz: afc4e5c842f2b38e8c2f9fa0247dfb4a01db2021ffccbb8d3e62f6acc904bf88
3
+ metadata.gz: f17b77ed0648665e282dc6f9483695eebcb955c08f4873350d5bbd01277c6534
4
+ data.tar.gz: e4e638cd17a013f3b3c1e012a5fd08f825fe6e43ce741050c31f7b084a718b96
5
5
  SHA512:
6
- metadata.gz: 23134246b45ee9c507e4fb52aca1539ecf2af4b036976f7f5a6c6fbe2dafc20f3a3da677014019f5366243b10f5c2b29521dc81e4911ea2820d966d21b5c54ea
7
- data.tar.gz: 72dea55baf64ca45b28d5642e8881004a6f0f2dc5f9f43e30d27a3392949a3994a16d805ce20e7bf2ac9f94ddce3d1817df33b152664b0dc582170281f03587d
6
+ metadata.gz: 9b22dfa3f6765ffbfeb912d775ce5eee8ee4db21be2236dc13679d816c43fff161a707f33ff280ccc4d101e729d593fd909df8ff38c4d8ac8187da48071a506d
7
+ data.tar.gz: df159e86bc400f53d3d85b4068fc158f600fc32bc5015e022305d27d8cf65487ae946a90934fc7737efdc8086b387a9988883490d7298d261c9520c68c9e1078
@@ -307,7 +307,7 @@ class PostHog
307
307
  symbolize_keys! value
308
308
  end
309
309
 
310
- all_person_properties = { "$current_distinct_id" => distinct_id }.merge(person_properties)
310
+ all_person_properties = { "distinct_id" => distinct_id }.merge(person_properties)
311
311
 
312
312
  all_group_properties = {}
313
313
  if groups
@@ -220,7 +220,7 @@ class PostHog
220
220
  end
221
221
 
222
222
  def self.relative_date_parse_for_feature_flag_matching(value)
223
- match = /^([0-9]+)([a-z])$/.match(value)
223
+ match = /^-?([0-9]+)([a-z])$/.match(value)
224
224
  parsed_dt = DateTime.now.new_offset(0)
225
225
  if match
226
226
  number = match[1].to_i
@@ -310,20 +310,20 @@ class PostHog
310
310
  else
311
311
  self.compare(override_value.to_s, value.to_s, operator)
312
312
  end
313
- when 'is_date_before', 'is_date_after', 'is_relative_date_before', 'is_relative_date_after'
314
- if operator == 'is_relative_date_before' || operator == 'is_relative_date_after'
315
- parsed_date = self.relative_date_parse_for_feature_flag_matching(value.to_s)
316
- override_date = PostHog::Utils.convert_to_datetime(override_value.to_s)
317
- else
313
+ when 'is_date_before', 'is_date_after'
314
+ override_date = PostHog::Utils.convert_to_datetime(override_value.to_s)
315
+ parsed_date = self.relative_date_parse_for_feature_flag_matching(value.to_s)
316
+
317
+ if parsed_date.nil?
318
318
  parsed_date = PostHog::Utils.convert_to_datetime(value.to_s)
319
- override_date = PostHog::Utils.convert_to_datetime(override_value.to_s)
320
319
  end
320
+
321
321
  if !parsed_date
322
322
  raise InconclusiveMatchError.new("Invalid date format")
323
323
  end
324
- if operator == 'is_date_before' or operator == 'is_relative_date_before'
324
+ if operator == 'is_date_before'
325
325
  return override_date < parsed_date
326
- elsif operator == 'is_date_after' or operator == 'is_relative_date_after'
326
+ elsif operator == 'is_date_after'
327
327
  return override_date > parsed_date
328
328
  end
329
329
  else
@@ -1,3 +1,3 @@
1
1
  class PostHog
2
- VERSION = '2.4.1'
2
+ VERSION = '2.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posthog-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby