posthog-ruby 3.23.0 → 3.23.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: e7ff2c46e36aab832b4c88e8005b527e738b488a95c7d7d5537317a6391ae417
4
- data.tar.gz: 7e2ce4bf172e23a280bc3c92d0552448ddea56a1ddb51c8959f82501d139bdaa
3
+ metadata.gz: 8312afa290c47eecb33301291d002d8ae16c2131ea474e8363c1691e4a8310ab
4
+ data.tar.gz: 2ca7dc85f81596e0dd0e3660a369e5b57a77e9c36bfe38ed6efe7da1d920c3a2
5
5
  SHA512:
6
- metadata.gz: 47cd7dc401b863342436a736d61d98ce43427acf8bcbd6e699a604712fbf76aaa7bcafb2e2c3c27e6fea722e5b1cd1691df082e087d88a8acd97a4c37d18420e
7
- data.tar.gz: 012d3cd84c4cdf1813f4e4bb65aaff4ddb927ef92be625c88d6fa2973e775d03239c727996c1a40db5abd388dd40e37ee7ecefe7068c79ec6241c9cf1ca20dc0
6
+ metadata.gz: 8932336a40c68e91b496b6c4edbf7d07916af5882c127180975fb2f83f7dbae6798000a8eeed92217affd9ec619572ff75b670b00d24df5c8e605c87cad881ac
7
+ data.tar.gz: 3cbdcfcbd72157b4c9745a2f65813dff3a759fbecb6330846865fbfb459df143dfd1bf808b7a7302e86d1f9f043c8b03a06f6214046f4673ec62a0fe05b64814
@@ -262,7 +262,8 @@ module PostHog
262
262
  # invalid and `:message_id` is a valid UUID, it is sent as `uuid` for backwards compatibility.
263
263
  # If neither value is valid, the SDK generates a `uuid`. SDK metadata is sent as `$lib` and
264
264
  # `$lib_version` properties.
265
- # @option attrs [Time] :timestamp When the event occurred (optional)
265
+ # @option attrs [Time] :timestamp When the event occurred (optional). UTC is preferred;
266
+ # non-UTC values are converted to the equivalent UTC instant before serialization.
266
267
  # @option attrs [String] :distinct_id The ID for this user in your database
267
268
 
268
269
  # Captures an event
@@ -472,7 +473,7 @@ module PostHog
472
473
  # @param send_feature_flag_events [Boolean] Whether to capture `$feature_flag_called` for this access.
473
474
  # @return [Boolean, nil] Whether the flag is enabled, or nil when the flag could not be evaluated.
474
475
  # TODO: In future version, rename to `feature_flag_enabled?`
475
- def is_feature_enabled( # rubocop:disable Naming/PredicateName
476
+ def is_feature_enabled( # rubocop:disable Naming/PredicatePrefix
476
477
  flag_key,
477
478
  distinct_id,
478
479
  groups: {},
@@ -712,8 +713,8 @@ module PostHog
712
713
  enabled: ff.enabled ? true : false,
713
714
  variant: ff.variant,
714
715
  payload: FeatureFlagResult.parse_payload(ff.payload),
715
- id: metadata ? metadata.id : nil,
716
- version: metadata ? metadata.version : nil,
716
+ id: metadata&.id,
717
+ version: metadata&.version,
717
718
  reason: reason ? (reason.description || reason.code) : nil,
718
719
  locally_evaluated: false,
719
720
  has_experiment: metadata&.has_experiment
@@ -150,7 +150,7 @@ module PostHog
150
150
  properties['$is_server'] = true if is_server
151
151
 
152
152
  parsed = {
153
- timestamp: datetime_in_iso8601(timestamp),
153
+ timestamp: time_in_iso8601(timestamp.getutc),
154
154
  distinct_id: distinct_id,
155
155
  properties: properties
156
156
  }
@@ -17,7 +17,7 @@ module PostHog
17
17
 
18
18
  # @return [Boolean]
19
19
  # TODO: Rename to `requesting?` in future version
20
- def is_requesting? # rubocop:disable Naming/PredicateName
20
+ def is_requesting? # rubocop:disable Naming/PredicatePrefix
21
21
  false
22
22
  end
23
23
 
@@ -113,7 +113,7 @@ module PostHog
113
113
  #
114
114
  # @return [Boolean] Whether the worker has outstanding requests.
115
115
  # TODO: Rename to `requesting?` in future version
116
- def is_requesting? # rubocop:disable Naming/PredicateName
116
+ def is_requesting? # rubocop:disable Naming/PredicatePrefix
117
117
  ensure_current_process!
118
118
 
119
119
  @lock.synchronize { !@batch.empty? }
data/lib/posthog/utils.rb CHANGED
@@ -111,7 +111,7 @@ module PostHog
111
111
  UTC_OFFSET_WITHOUT_COLON = UTC_OFFSET_WITH_COLON.sub(':', '')
112
112
 
113
113
  # TODO: Rename to `valid_regex?` in future version
114
- def is_valid_regex(regex) # rubocop:disable Naming/PredicateName
114
+ def is_valid_regex(regex) # rubocop:disable Naming/PredicatePrefix
115
115
  Regexp.new(regex)
116
116
  true
117
117
  rescue RegexpError
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostHog
4
- VERSION = '3.23.0'
4
+ VERSION = '3.23.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.23.0
4
+ version: 3.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 4.0.6
78
+ rubygems_version: 4.0.16
79
79
  specification_version: 4
80
80
  summary: PostHog library
81
81
  test_files: []