posthog-ruby 3.28.1 → 3.28.2

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: 8c845018be0215ef9e7b28c605f4ed856815d4eb63076c2b76aa307a04fa5a47
4
- data.tar.gz: 9e0779372eea8be6e073c3d200159f7f1ac31986b3390147987368935f4710f4
3
+ metadata.gz: cadcd587c8b67720c3ce501cf2df4924313a8e585aa2736cb501b43e760108f1
4
+ data.tar.gz: 44581dc2e70dd510e7dd8668a65f82526e97077f6634fb7062540615dda42b9d
5
5
  SHA512:
6
- metadata.gz: 74eff3ba167884c7059a1dfed30ac4774d17bac42885096373f6949cead1bbb4d81c226ff8dd1c59361b824760c046027fa5470bf65fb416002a8c564f2b577f
7
- data.tar.gz: 42b6c6c956e45ab5352c1e9f93a5210c188fa129df7c24da1ca8efec6781baa820564a1bce965fc00176c69ab25273e8873c1220c821899ee14ce210c267bee4
6
+ metadata.gz: 392bc21969769e782adf4b725f499ec0e43c2ce882b9ebdeddc856f7f5543d0de1f047075a0c4f49f8e45f2cd713285e097c69c7250b407452f5dd5e68b6ea77
7
+ data.tar.gz: 6d08ae49f0c082c44bb6278b8272af13345b37732bf21e8eba34671f97b4279b32caa8292907a8d84599363268280dfbd54350ef12a9d00eb7b7c220b8675fa9
@@ -689,6 +689,11 @@ module PostHog
689
689
  end.downcase
690
690
  end
691
691
 
692
+ def self.string_operand(value)
693
+ value.nil? ? 'null' : value.to_s
694
+ end
695
+ private_class_method :string_operand
696
+
692
697
  def self.exact_property_match?(filter, value, property_matching_version)
693
698
  return legacy_truthy?(filter) == legacy_truthy?(value) if property_matching_version != 2 && boolean_like?(filter)
694
699
  return legacy_truthy?(value) if filter.is_a?(Array) && filter.empty?
@@ -733,21 +738,21 @@ module PostHog
733
738
  when 'is_set'
734
739
  property_values.key?(key)
735
740
  when 'icontains'
736
- override_value.to_s.downcase(:ascii).include?(value.to_s.downcase(:ascii))
741
+ string_operand(override_value).downcase(:ascii).include?(value.to_s.downcase(:ascii))
737
742
  when 'not_icontains'
738
- !override_value.to_s.downcase(:ascii).include?(value.to_s.downcase(:ascii))
743
+ !string_operand(override_value).downcase(:ascii).include?(value.to_s.downcase(:ascii))
739
744
  when 'starts_with'
740
- override_value.to_s.downcase(:ascii).start_with?(value.to_s.downcase(:ascii))
745
+ string_operand(override_value).downcase(:ascii).start_with?(value.to_s.downcase(:ascii))
741
746
  when 'not_starts_with'
742
- !override_value.to_s.downcase(:ascii).start_with?(value.to_s.downcase(:ascii))
747
+ !string_operand(override_value).downcase(:ascii).start_with?(value.to_s.downcase(:ascii))
743
748
  when 'ends_with'
744
- override_value.to_s.downcase(:ascii).end_with?(value.to_s.downcase(:ascii))
749
+ string_operand(override_value).downcase(:ascii).end_with?(value.to_s.downcase(:ascii))
745
750
  when 'not_ends_with'
746
- !override_value.to_s.downcase(:ascii).end_with?(value.to_s.downcase(:ascii))
751
+ !string_operand(override_value).downcase(:ascii).end_with?(value.to_s.downcase(:ascii))
747
752
  when 'regex'
748
- PostHog::Utils.is_valid_regex(value.to_s) && !Regexp.new(value.to_s).match(override_value.to_s).nil?
753
+ PostHog::Utils.is_valid_regex(value.to_s) && !Regexp.new(value.to_s).match(string_operand(override_value)).nil?
749
754
  when 'not_regex'
750
- PostHog::Utils.is_valid_regex(value.to_s) && Regexp.new(value.to_s).match(override_value.to_s).nil?
755
+ PostHog::Utils.is_valid_regex(value.to_s) && Regexp.new(value.to_s).match(string_operand(override_value)).nil?
751
756
  when 'gt', 'gte', 'lt', 'lte'
752
757
  parsed_value = parse_finite_number(value)
753
758
  raise InconclusiveMatchError, 'Invalid numeric condition' if parsed_value.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostHog
4
- VERSION = '3.28.1'
4
+ VERSION = '3.28.2'
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.28.1
4
+ version: 3.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''