posthog-ruby 2.4.1 → 2.4.3

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: 4045560a50a4339e398f41b14198c8f7e8a89b03e9c67c4051f9c3e8a3ddc023
4
+ data.tar.gz: f5db284d85ca9b085205e435c236a0b74da89c141c2c25254307811308ed038f
5
5
  SHA512:
6
- metadata.gz: 23134246b45ee9c507e4fb52aca1539ecf2af4b036976f7f5a6c6fbe2dafc20f3a3da677014019f5366243b10f5c2b29521dc81e4911ea2820d966d21b5c54ea
7
- data.tar.gz: 72dea55baf64ca45b28d5642e8881004a6f0f2dc5f9f43e30d27a3392949a3994a16d805ce20e7bf2ac9f94ddce3d1817df33b152664b0dc582170281f03587d
6
+ metadata.gz: b841977f8e744a5420d9fdec891e98d82b486c558dcbbf33c1ecf2441031b454bd5ea62323904e5600458a31fb11263513d49944edfd0c916359fecd1f4881a6
7
+ data.tar.gz: 2f959dc54d97743c25abe0e3d3ae385f781a05fcdd2c8bc97d84d0909475ba1b183d546086b4cc943cc416c2c2f642810e838b869608779ae518b3482b85a77b
@@ -52,8 +52,6 @@ class PostHog
52
52
  )
53
53
 
54
54
  @distinct_id_has_sent_flag_calls = SizeLimitedHash.new(Defaults::MAX_HASH_SIZE) { |hash, key| hash[key] = Array.new }
55
-
56
- at_exit { @worker_thread && @worker_thread[:should_exit] = true }
57
55
  end
58
56
 
59
57
  # Synchronously waits until the worker has cleared the queue.
@@ -307,7 +305,7 @@ class PostHog
307
305
  symbolize_keys! value
308
306
  end
309
307
 
310
- all_person_properties = { "$current_distinct_id" => distinct_id }.merge(person_properties)
308
+ all_person_properties = { "distinct_id" => distinct_id }.merge(person_properties)
311
309
 
312
310
  all_group_properties = {}
313
311
  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
@@ -229,7 +229,7 @@ class PostHog
229
229
  # Guard against overflow, disallow numbers greater than 10_000
230
230
  return nil
231
231
  end
232
-
232
+
233
233
  interval = match[2]
234
234
  if interval == "h"
235
235
  parsed_dt = parsed_dt - (number/24r)
@@ -254,7 +254,7 @@ class PostHog
254
254
  def self.match_property(property, property_values)
255
255
  # only looks for matches where key exists in property_values
256
256
  # doesn't support operator is_not_set
257
-
257
+
258
258
  PostHog::Utils.symbolize_keys! property
259
259
  PostHog::Utils.symbolize_keys! property_values
260
260
 
@@ -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
@@ -436,7 +436,7 @@ class PostHog
436
436
  if !rollout_percentage.nil? and _hash(flag[:key], distinct_id) > (rollout_percentage.to_f/100)
437
437
  return false
438
438
  end
439
-
439
+
440
440
  return true
441
441
  end
442
442
 
@@ -531,6 +531,6 @@ class PostHog
531
531
  logger.debug("Unable to complete request to #{uri}")
532
532
  throw e
533
533
  end
534
- end
534
+ end
535
535
  end
536
536
  end
@@ -1,3 +1,3 @@
1
1
  class PostHog
2
- VERSION = '2.4.1'
2
+ VERSION = '2.4.3'
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.3
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-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -44,70 +44,70 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.3'
47
+ version: '13.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.3'
54
+ version: '13.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '3.13'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '3.13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tzinfo
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '='
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.2.1
75
+ version: '2.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '='
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.2.1
82
+ version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 4.1.11
89
+ version: '7.1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 4.1.11
96
+ version: '7.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: oj
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 3.6.2
103
+ version: 3.16.3
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 3.6.2
110
+ version: 3.16.3
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement