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 +4 -4
- data/lib/posthog/feature_flags.rb +13 -8
- 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: cadcd587c8b67720c3ce501cf2df4924313a8e585aa2736cb501b43e760108f1
|
|
4
|
+
data.tar.gz: 44581dc2e70dd510e7dd8668a65f82526e97077f6634fb7062540615dda42b9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
741
|
+
string_operand(override_value).downcase(:ascii).include?(value.to_s.downcase(:ascii))
|
|
737
742
|
when 'not_icontains'
|
|
738
|
-
!override_value.
|
|
743
|
+
!string_operand(override_value).downcase(:ascii).include?(value.to_s.downcase(:ascii))
|
|
739
744
|
when 'starts_with'
|
|
740
|
-
override_value.
|
|
745
|
+
string_operand(override_value).downcase(:ascii).start_with?(value.to_s.downcase(:ascii))
|
|
741
746
|
when 'not_starts_with'
|
|
742
|
-
!override_value.
|
|
747
|
+
!string_operand(override_value).downcase(:ascii).start_with?(value.to_s.downcase(:ascii))
|
|
743
748
|
when 'ends_with'
|
|
744
|
-
override_value.
|
|
749
|
+
string_operand(override_value).downcase(:ascii).end_with?(value.to_s.downcase(:ascii))
|
|
745
750
|
when 'not_ends_with'
|
|
746
|
-
!override_value.
|
|
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
|
|
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
|
|
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?
|
data/lib/posthog/version.rb
CHANGED