flagsmith 5.0.0 → 5.1.0
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +47 -0
- data/Gemfile.lock +18 -11
- data/Makefile +28 -0
- data/codspeed.yml +5 -0
- data/lib/flagsmith/engine/core.rb +74 -42
- data/lib/flagsmith/engine/features/constants.rb +2 -0
- data/lib/flagsmith/engine/lazy_flags.rb +118 -0
- data/lib/flagsmith/engine/mappers/identity.rb +2 -2
- data/lib/flagsmith/engine/mappers.rb +32 -1
- data/lib/flagsmith/engine/segments/constants.rb +3 -0
- data/lib/flagsmith/engine/segments/evaluator.rb +31 -11
- data/lib/flagsmith/engine/segments/models.rb +6 -10
- data/lib/flagsmith/version.rb +1 -1
- data/lib/flagsmith.rb +2 -3
- data/renovate.json +43 -0
- metadata +33 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a0f9d447911471906fafc777ab80c1d4cbf406446b6b9bd5a3485471e70f28e
|
|
4
|
+
data.tar.gz: ff12db766ba765a0720ae6a29c8b2e46ebf0566119063a2fbb449e6d676d3bad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08117c66b63caa9a6535e9eeea8eb0d16058defb91dc1350ffdf76da774c542b2fc50d33d93614d0778a98a3f37b879b65c25ea5b835c19fa9f1b2a8aad37849'
|
|
7
|
+
data.tar.gz: a96d91a73dbf906979e5c8cd475b3307952a48b4a55b9bcf3843cc584f13e74be5a15c267ad4a45483cee3f3107b82242404cec30bdcfb7f3225f52c75433446
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{".":"5.
|
|
1
|
+
{".":"5.1.0"}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.1.0](https://github.com/Flagsmith/flagsmith-ruby-client/compare/v5.0.1...v5.1.0) (2026-10-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Evaluate flags that depend on other flags ([#120](https://github.com/Flagsmith/flagsmith-ruby-client/issues/120)) ([e4efc8f](https://github.com/Flagsmith/flagsmith-ruby-client/commit/e4efc8f36b7edc647bcd696b199775d7e22ddc63))
|
|
9
|
+
* Ruby 4 support ([#116](https://github.com/Flagsmith/flagsmith-ruby-client/issues/116)) ([51544ab](https://github.com/Flagsmith/flagsmith-ruby-client/commit/51544abcfc593efc5d0bb8043744013526a8e488))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* Align numeric trait conditions with flagsmith-engine ([#118](https://github.com/Flagsmith/flagsmith-ruby-client/issues/118)) ([5b154ca](https://github.com/Flagsmith/flagsmith-ruby-client/commit/5b154caab68f746d62dbfa05280b6a19b9277223))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### CI
|
|
18
|
+
|
|
19
|
+
* Benchmark the SDK with CodSpeed ([#117](https://github.com/Flagsmith/flagsmith-ruby-client/issues/117)) ([a95445c](https://github.com/Flagsmith/flagsmith-ruby-client/commit/a95445c3a6580153c49ef19bcb5f58807ddaa624))
|
|
20
|
+
* Label Renovate's SDK spec bump PRs ([#111](https://github.com/Flagsmith/flagsmith-ruby-client/issues/111)) ([ef6c84e](https://github.com/Flagsmith/flagsmith-ruby-client/commit/ef6c84e88e953e2b7d1c2139baa5764a59b3ec25))
|
|
21
|
+
* Pin test runner to ubuntu-24.04 for Ruby 3.0 support ([#115](https://github.com/Flagsmith/flagsmith-ruby-client/issues/115)) ([f10b360](https://github.com/Flagsmith/flagsmith-ruby-client/commit/f10b360da6940c037ffb02c7b8e1d01f1d2385c3))
|
|
22
|
+
* Run the Flagsmith SDK behavioural spec ([#110](https://github.com/Flagsmith/flagsmith-ruby-client/issues/110)) ([74be985](https://github.com/Flagsmith/flagsmith-ruby-client/commit/74be98598292b2c4dad634412c4ad7ad0465b268))
|
|
23
|
+
|
|
24
|
+
## [5.0.1](https://github.com/Flagsmith/flagsmith-ruby-client/compare/v5.0.0...v5.0.1) (2026-08-26)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* exclude-identities-when-traits-is-undefined ([#96](https://github.com/Flagsmith/flagsmith-ruby-client/issues/96)) ([f888d4c](https://github.com/Flagsmith/flagsmith-ruby-client/commit/f888d4c03c45d7fe8b1a994f2ca512bf7f9f0fe0))
|
|
30
|
+
* removed-dango-id-usage-in-mapper ([#94](https://github.com/Flagsmith/flagsmith-ruby-client/issues/94)) ([a86fc3e](https://github.com/Flagsmith/flagsmith-ruby-client/commit/a86fc3e6cf93c2e99e30b1ed7d2ff144d47be4ee))
|
|
31
|
+
* respect rule type for sub-rules in segment evaluation ([#101](https://github.com/Flagsmith/flagsmith-ruby-client/issues/101)) ([e5c52d8](https://github.com/Flagsmith/flagsmith-ruby-client/commit/e5c52d8a8d06c289e9b24c9f62f021d270dbe1d9))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### CI
|
|
35
|
+
|
|
36
|
+
* setup Renovate for engine-test-data tracking ([#100](https://github.com/Flagsmith/flagsmith-ruby-client/issues/100)) ([87bd746](https://github.com/Flagsmith/flagsmith-ruby-client/commit/87bd7465a896801cdf5b4fba48f2b88ae1972198))
|
|
37
|
+
* track engine-test-data semver tags via Renovate ([#102](https://github.com/Flagsmith/flagsmith-ruby-client/issues/102)) ([77da402](https://github.com/Flagsmith/flagsmith-ruby-client/commit/77da4025af5e97ea0fd89dc27591d3ab9606cb9d))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Dependency Updates
|
|
41
|
+
|
|
42
|
+
* Bump faraday from 2.9.0 to 2.14.1 ([#98](https://github.com/Flagsmith/flagsmith-ruby-client/issues/98)) ([1bdbdbf](https://github.com/Flagsmith/flagsmith-ruby-client/commit/1bdbdbf9876f117f88165e7736756413cc63826a))
|
|
43
|
+
* bump rexml from 3.3.9 to 3.4.2 ([#85](https://github.com/Flagsmith/flagsmith-ruby-client/issues/85)) ([16cb374](https://github.com/Flagsmith/flagsmith-ruby-client/commit/16cb3741a673441addc7accc399f74dcd31314a3))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Other
|
|
47
|
+
|
|
48
|
+
* Remove amannn/action-semantic-pull-request workflow ([#97](https://github.com/Flagsmith/flagsmith-ruby-client/issues/97)) ([ddc0f21](https://github.com/Flagsmith/flagsmith-ruby-client/commit/ddc0f21d88f5e4325403ff6d7414e95f6283bc96))
|
|
49
|
+
|
|
3
50
|
## [5.0.0](https://github.com/Flagsmith/flagsmith-ruby-client/compare/v4.3.0...v5.0.0) (2025-11-12)
|
|
4
51
|
|
|
5
52
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
flagsmith (5.
|
|
4
|
+
flagsmith (5.1.0)
|
|
5
5
|
faraday (>= 2.0.1)
|
|
6
6
|
faraday-retry
|
|
7
7
|
jsonpath (~> 1.1)
|
|
@@ -11,24 +11,29 @@ GEM
|
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
13
|
ast (2.4.2)
|
|
14
|
+
benchmark (0.5.0)
|
|
14
15
|
byebug (11.1.3)
|
|
15
16
|
coderay (1.1.3)
|
|
16
17
|
diff-lcs (1.5.0)
|
|
17
|
-
faraday (2.
|
|
18
|
-
faraday-net_http (>= 2.0, < 3.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
faraday-
|
|
18
|
+
faraday (2.14.3)
|
|
19
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
20
|
+
json
|
|
21
|
+
logger
|
|
22
|
+
faraday-net_http (3.4.4)
|
|
23
|
+
net-http (~> 0.5)
|
|
24
|
+
faraday-retry (2.4.0)
|
|
22
25
|
faraday (~> 2.0)
|
|
23
26
|
gem-release (2.2.2)
|
|
24
|
-
json (2.
|
|
27
|
+
json (2.21.2)
|
|
25
28
|
jsonpath (1.1.5)
|
|
26
29
|
multi_json
|
|
27
30
|
language_server-protocol (3.17.0.3)
|
|
31
|
+
logger (1.7.0)
|
|
28
32
|
method_source (1.0.0)
|
|
29
33
|
multi_json (1.17.0)
|
|
30
|
-
net-http (0.
|
|
31
|
-
uri
|
|
34
|
+
net-http (0.9.1)
|
|
35
|
+
uri (>= 0.11.1)
|
|
36
|
+
ostruct (0.6.3)
|
|
32
37
|
parallel (1.24.0)
|
|
33
38
|
parser (3.3.0.4)
|
|
34
39
|
ast (~> 2.4.1)
|
|
@@ -43,7 +48,7 @@ GEM
|
|
|
43
48
|
rainbow (3.1.1)
|
|
44
49
|
rake (13.1.0)
|
|
45
50
|
regexp_parser (2.9.0)
|
|
46
|
-
rexml (3.
|
|
51
|
+
rexml (3.4.2)
|
|
47
52
|
rspec (3.12.0)
|
|
48
53
|
rspec-core (~> 3.12.0)
|
|
49
54
|
rspec-expectations (~> 3.12.0)
|
|
@@ -73,15 +78,17 @@ GEM
|
|
|
73
78
|
ruby-progressbar (1.13.0)
|
|
74
79
|
semantic (1.6.1)
|
|
75
80
|
unicode-display_width (2.5.0)
|
|
76
|
-
uri (
|
|
81
|
+
uri (1.1.1)
|
|
77
82
|
|
|
78
83
|
PLATFORMS
|
|
79
84
|
ruby
|
|
80
85
|
|
|
81
86
|
DEPENDENCIES
|
|
87
|
+
benchmark
|
|
82
88
|
bundler
|
|
83
89
|
flagsmith!
|
|
84
90
|
gem-release
|
|
91
|
+
ostruct
|
|
85
92
|
pry
|
|
86
93
|
pry-byebug
|
|
87
94
|
rake
|
data/Makefile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
SDK_BENCHMARKS := spec/sdk-benchmarks
|
|
2
|
+
CODSPEED_VERSION := 5.6.0
|
|
3
|
+
CODSPEED_INSTALLER_SHA256 := bf1bf63661e203bcabc0c84fdef0337f8658fc8340c467a6a3bca81040d99f40
|
|
4
|
+
|
|
5
|
+
INSTRUMENT_HOOKS := benchmarks/codspeed/instrument-hooks
|
|
6
|
+
CODSPEED_EXT := tmp/codspeed/codspeed.$(shell ruby -e 'print RbConfig::CONFIG["DLEXT"]')
|
|
7
|
+
|
|
8
|
+
$(SDK_BENCHMARKS)/environments:
|
|
9
|
+
git submodule update --init -- $(SDK_BENCHMARKS)
|
|
10
|
+
|
|
11
|
+
$(INSTRUMENT_HOOKS)/dist/core.c:
|
|
12
|
+
git submodule update --init -- $(INSTRUMENT_HOOKS)
|
|
13
|
+
|
|
14
|
+
$(CODSPEED_EXT): benchmarks/codspeed/codspeed.c benchmarks/codspeed/extconf.rb $(INSTRUMENT_HOOKS)/dist/core.c
|
|
15
|
+
mkdir -p $(@D)
|
|
16
|
+
cd $(@D) && ruby $(CURDIR)/benchmarks/codspeed/extconf.rb && $(MAKE)
|
|
17
|
+
|
|
18
|
+
.PHONY: install-codspeed
|
|
19
|
+
install-codspeed: $(SDK_BENCHMARKS)/environments
|
|
20
|
+
bundle install
|
|
21
|
+
installer=$$(mktemp) && \
|
|
22
|
+
curl -fsSL -o "$$installer" "https://codspeed.io/v$(CODSPEED_VERSION)/install.sh" && \
|
|
23
|
+
echo "$(CODSPEED_INSTALLER_SHA256) $$installer" | sha256sum --check --strict && \
|
|
24
|
+
bash "$$installer" --quiet
|
|
25
|
+
|
|
26
|
+
.PHONY: benchmark
|
|
27
|
+
benchmark: install-codspeed $(CODSPEED_EXT)
|
|
28
|
+
SDK_BENCHMARKS=$(SDK_BENCHMARKS) codspeed run --mode simulation --config codspeed.yml
|
data/codspeed.yml
ADDED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
require 'semantic'
|
|
4
4
|
require 'securerandom'
|
|
5
|
+
require 'set'
|
|
5
6
|
|
|
6
7
|
require_relative 'environments/models'
|
|
7
8
|
require_relative 'features/models'
|
|
8
9
|
require_relative 'features/constants'
|
|
9
10
|
require_relative 'identities/models'
|
|
11
|
+
require_relative 'lazy_flags'
|
|
10
12
|
require_relative 'organisations/models'
|
|
11
13
|
require_relative 'projects/models'
|
|
12
14
|
require_relative 'segments/evaluator'
|
|
@@ -16,7 +18,7 @@ require_relative 'mappers'
|
|
|
16
18
|
|
|
17
19
|
module Flagsmith
|
|
18
20
|
# Core evaluation logic for feature flags
|
|
19
|
-
module Engine
|
|
21
|
+
module Engine # rubocop:disable Metrics/ModuleLength
|
|
20
22
|
extend self
|
|
21
23
|
include Flagsmith::Engine::Utils::HashFunc
|
|
22
24
|
include Flagsmith::Engine::Features::TargetingReasons
|
|
@@ -27,9 +29,11 @@ module Flagsmith
|
|
|
27
29
|
# @param evaluation_context [Hash] The evaluation context
|
|
28
30
|
# @return [Hash] Evaluation result with flags and segments
|
|
29
31
|
def get_evaluation_result(evaluation_context)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
lazy_flags = LazyFlags.new(get_enriched_context(evaluation_context))
|
|
33
|
+
evaluation_context = lazy_flags.context
|
|
34
|
+
segments, segment_overrides = evaluate_segments(evaluation_context, lazy_flags)
|
|
32
35
|
flags = evaluate_features(evaluation_context, segment_overrides)
|
|
36
|
+
lazy_flags.apply_to(flags) if lazy_flags.used?
|
|
33
37
|
{
|
|
34
38
|
flags: flags,
|
|
35
39
|
segments: segments
|
|
@@ -37,27 +41,30 @@ module Flagsmith
|
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
# Returns { segments: EvaluationResultSegments; segmentOverrides: Record<string, SegmentOverride>; }
|
|
40
|
-
def evaluate_segments(evaluation_context)
|
|
44
|
+
def evaluate_segments(evaluation_context, lazy_flags)
|
|
41
45
|
return [], {} if evaluation_context[:segments].nil?
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
matching_segments = evaluation_context[:segments].each_value.select do |segment|
|
|
48
|
+
cycle_hits = lazy_flags.cycle_hits
|
|
49
|
+
context_in_segment?(evaluation_context, segment) && lazy_flags.cycle_hits == cycle_hits
|
|
50
|
+
end
|
|
44
51
|
|
|
45
|
-
segments =
|
|
52
|
+
segments = matching_segments.map do |segment|
|
|
46
53
|
{ name: segment[:name], metadata: segment[:metadata] }.compact
|
|
47
54
|
end
|
|
48
55
|
|
|
49
|
-
segment_overrides = process_segment_overrides(
|
|
56
|
+
segment_overrides = process_segment_overrides(matching_segments)
|
|
50
57
|
|
|
51
58
|
[segments, segment_overrides]
|
|
52
59
|
end
|
|
53
60
|
|
|
54
61
|
# Returns Record<string: override.name, SegmentOverride>
|
|
55
|
-
def process_segment_overrides(
|
|
62
|
+
def process_segment_overrides(matching_segments) # rubocop:disable Metrics/MethodLength
|
|
56
63
|
segment_overrides = {}
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
matching_segments.each do |segment|
|
|
59
66
|
Array(segment[:overrides]).each do |override|
|
|
60
|
-
next unless
|
|
67
|
+
next unless wins_over?(override, segment_overrides[override[:name]]&.dig(:feature))
|
|
61
68
|
|
|
62
69
|
segment_overrides[override[:name]] = {
|
|
63
70
|
feature: override,
|
|
@@ -71,65 +78,94 @@ module Flagsmith
|
|
|
71
78
|
|
|
72
79
|
def evaluate_features(evaluation_context, segment_overrides)
|
|
73
80
|
identity_key = get_identity_key(evaluation_context)
|
|
81
|
+
targeted_feature_names = get_targeted_feature_names(evaluation_context)
|
|
74
82
|
|
|
75
83
|
(evaluation_context[:features] || {}).each_with_object({}) do |(_, feature), flags|
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
flags[feature[:name].to_sym] =
|
|
85
|
+
get_feature_flag_result(feature, segment_overrides[feature[:name]], identity_key, targeted_feature_names)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Returns the flag result of a feature, served by its segment override if any, or else by its environment default
|
|
90
|
+
def get_feature_flag_result(feature, segment_override, identity_key, targeted_feature_names)
|
|
91
|
+
return get_flag_result(segment_override[:feature], identity_key, targeting_match_reason(segment_override)) if segment_override
|
|
92
|
+
|
|
93
|
+
get_flag_result(feature, identity_key, fallback_reason(feature[:name], targeted_feature_names))
|
|
94
|
+
end
|
|
78
95
|
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
# Returns the names of the features overridden by at least one segment
|
|
97
|
+
def get_targeted_feature_names(evaluation_context)
|
|
98
|
+
names = {}
|
|
99
|
+
evaluation_context[:segments]&.each_value do |segment|
|
|
100
|
+
segment[:overrides]&.each { |override| names[override[:name]] = true }
|
|
81
101
|
end
|
|
102
|
+
names
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Returns the reason for a flag served by a segment override
|
|
106
|
+
def targeting_match_reason(segment_override)
|
|
107
|
+
"#{TARGETING_REASON_TARGETING_MATCH}; segment=#{segment_override[:segment_name]}"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Returns the reason for a flag served by its environment default:
|
|
111
|
+
# DEFAULT if the feature has segment overrides that did not match, STATIC if it has none
|
|
112
|
+
def fallback_reason(feature_name, targeted_feature_names)
|
|
113
|
+
targeted_feature_names.key?(feature_name) ? TARGETING_REASON_DEFAULT : TARGETING_REASON_STATIC
|
|
82
114
|
end
|
|
83
115
|
|
|
84
|
-
# Returns {value: any; reason?: string}
|
|
116
|
+
# Returns {name: string; enabled: boolean; value: any; reason: string; variant?: string; metadata?: any}
|
|
117
|
+
def get_flag_result(feature, identity_key, reason)
|
|
118
|
+
evaluated = evaluate_feature_value(feature, identity_key)
|
|
119
|
+
|
|
120
|
+
flag_result = {
|
|
121
|
+
name: feature[:name],
|
|
122
|
+
enabled: feature[:enabled],
|
|
123
|
+
value: evaluated[:value],
|
|
124
|
+
reason: evaluated[:reason] || reason,
|
|
125
|
+
variant: evaluated[:variant]
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
flag_result[:metadata] = feature[:metadata] if feature[:metadata]
|
|
129
|
+
flag_result
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Returns {value: any; reason?: string; variant?: string}
|
|
85
133
|
def evaluate_feature_value(feature, identity_key = nil)
|
|
86
134
|
return get_multivariate_feature_value(feature, identity_key) if feature[:variants]&.any? && identity_key
|
|
87
135
|
|
|
88
|
-
{ value: feature[:value], reason: nil }
|
|
136
|
+
{ value: feature[:value], reason: nil, variant: nil }
|
|
89
137
|
end
|
|
90
138
|
|
|
91
|
-
# Returns {value: any; reason?: string}
|
|
139
|
+
# Returns {value: any; reason?: string; variant: string}
|
|
92
140
|
def get_multivariate_feature_value(feature, identity_key)
|
|
93
141
|
percentage_value = hashed_percentage_for_object_ids([feature[:key], identity_key])
|
|
94
|
-
sorted_variants = (feature[:variants] || []).sort_by { |v| v[:priority] ||
|
|
142
|
+
sorted_variants = (feature[:variants] || []).sort_by { |v| v[:priority] || DEFAULT_PRIORITY }
|
|
95
143
|
|
|
96
144
|
variant = find_matching_variant(sorted_variants, percentage_value)
|
|
97
|
-
variant || { value: feature[:value], reason: nil }
|
|
145
|
+
variant || { value: feature[:value], reason: nil, variant: 'control' }
|
|
98
146
|
end
|
|
99
147
|
|
|
100
148
|
def find_matching_variant(sorted_variants, percentage_value)
|
|
101
149
|
start_percentage = 0
|
|
102
150
|
sorted_variants.each do |variant|
|
|
103
151
|
limit = start_percentage + variant[:weight]
|
|
104
|
-
|
|
152
|
+
if start_percentage <= percentage_value && percentage_value < limit
|
|
153
|
+
return { value: variant[:value], reason: "#{TARGETING_REASON_SPLIT}; weight=#{variant[:weight]}", variant: variant[:key] }
|
|
154
|
+
end
|
|
105
155
|
|
|
106
156
|
start_percentage = limit
|
|
107
157
|
end
|
|
108
158
|
nil
|
|
109
159
|
end
|
|
110
160
|
|
|
111
|
-
#
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
161
|
+
# Whether a segment override takes precedence over the one held so far.
|
|
162
|
+
# The lowest priority wins, and the first seen wins a tie.
|
|
163
|
+
def wins_over?(candidate, incumbent)
|
|
164
|
+
incumbent.nil? || (candidate[:priority] || DEFAULT_PRIORITY) < (incumbent[:priority] || DEFAULT_PRIORITY)
|
|
115
165
|
end
|
|
116
166
|
|
|
117
167
|
private
|
|
118
168
|
|
|
119
|
-
def build_flag_result(feature, identity_key, segment_override)
|
|
120
|
-
evaluated = evaluate_feature_value(feature, identity_key)
|
|
121
|
-
|
|
122
|
-
flag_result = {
|
|
123
|
-
name: feature[:name],
|
|
124
|
-
enabled: feature[:enabled],
|
|
125
|
-
value: evaluated[:value],
|
|
126
|
-
reason: evaluated[:reason] || (segment_override ? "#{TARGETING_REASON_TARGETING_MATCH}; segment=#{segment_override[:segment_name]}" : TARGETING_REASON_DEFAULT)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
flag_result[:metadata] = feature[:metadata] if feature[:metadata]
|
|
130
|
-
flag_result
|
|
131
|
-
end
|
|
132
|
-
|
|
133
169
|
# Extract identity key from evaluation context
|
|
134
170
|
#
|
|
135
171
|
# @param evaluation_context [Hash] The evaluation context
|
|
@@ -139,9 +175,5 @@ module Flagsmith
|
|
|
139
175
|
|
|
140
176
|
evaluation_context[:identity][:key]
|
|
141
177
|
end
|
|
142
|
-
|
|
143
|
-
def stronger_priority?(priority_a, priority_b)
|
|
144
|
-
(priority_a || WEAKEST_PRIORITY) < (priority_b || WEAKEST_PRIORITY)
|
|
145
|
-
end
|
|
146
178
|
end
|
|
147
179
|
end
|
|
@@ -6,8 +6,10 @@ module Flagsmith
|
|
|
6
6
|
# Targeting reason constants for evaluation results
|
|
7
7
|
module TargetingReasons
|
|
8
8
|
TARGETING_REASON_DEFAULT = 'DEFAULT'
|
|
9
|
+
TARGETING_REASON_STATIC = 'STATIC'
|
|
9
10
|
TARGETING_REASON_TARGETING_MATCH = 'TARGETING_MATCH'
|
|
10
11
|
TARGETING_REASON_SPLIT = 'SPLIT'
|
|
12
|
+
TARGETING_REASON_CIRCULAR_DEPENDENCY = 'ERROR; code=CIRCULAR_DEPENDENCY'
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
15
|
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'set'
|
|
4
|
+
|
|
5
|
+
module Flagsmith
|
|
6
|
+
module Engine
|
|
7
|
+
# The `$.flags` of an evaluation context, resolving a flag the first time a segment condition reads it.
|
|
8
|
+
#
|
|
9
|
+
# Flags are only reachable by name: JSONPath reads them through `dig`.
|
|
10
|
+
class LazyFlags
|
|
11
|
+
# The evaluation context, with `$.flags` bound to this instance
|
|
12
|
+
attr_reader :context
|
|
13
|
+
|
|
14
|
+
# Incremented whenever a dependency cycle is cut. A segment whose evaluation increments it
|
|
15
|
+
# read a flag that could not be resolved, so it must not match.
|
|
16
|
+
attr_reader :cycle_hits
|
|
17
|
+
|
|
18
|
+
def initialize(context)
|
|
19
|
+
@context = context.merge(flags: self)
|
|
20
|
+
@cycle_hits = 0
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @param feature_name [String]
|
|
24
|
+
# @return [Hash, nil] The flag result, or nil for a feature absent from the context or in a cycle
|
|
25
|
+
def dig(feature_name)
|
|
26
|
+
start unless used?
|
|
27
|
+
resolve(feature_name) unless @resolved.key?(feature_name)
|
|
28
|
+
@resolved[feature_name]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Whether a segment condition read any flag
|
|
32
|
+
def used?
|
|
33
|
+
!@resolved.nil?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Applies the flags resolved for segment conditions over the single-pass flag results
|
|
37
|
+
#
|
|
38
|
+
# @param flags [Hash{Symbol => Hash}] The flag results, keyed by feature name
|
|
39
|
+
def apply_to(flags)
|
|
40
|
+
@resolved.each_value { |flag| flags[flag[:name].to_sym] = flag }
|
|
41
|
+
@cyclic.each do |feature_name|
|
|
42
|
+
flag = flags[feature_name.to_sym]
|
|
43
|
+
flag[:reason] = Features::TargetingReasons::TARGETING_REASON_CIRCULAR_DEPENDENCY if flag
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def start
|
|
50
|
+
@resolved = {}
|
|
51
|
+
@cyclic = Set.new
|
|
52
|
+
@resolving = []
|
|
53
|
+
@segment_matches = {}
|
|
54
|
+
@segment_keys_by_feature_name = {}
|
|
55
|
+
(@context[:segments] || {}).each do |segment_key, segment|
|
|
56
|
+
Array(segment[:overrides]).each do |override|
|
|
57
|
+
(@segment_keys_by_feature_name[override[:name]] ||= []) << segment_key
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def resolve(feature_name) # rubocop:disable Metrics/MethodLength
|
|
63
|
+
if @resolving.include?(feature_name)
|
|
64
|
+
@cyclic.merge(@resolving[@resolving.index(feature_name)..])
|
|
65
|
+
@cycle_hits += 1
|
|
66
|
+
return
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
feature = find_feature(feature_name)
|
|
70
|
+
return unless feature
|
|
71
|
+
|
|
72
|
+
@resolving.push(feature_name)
|
|
73
|
+
begin
|
|
74
|
+
segment_override = find_segment_override(feature_name)
|
|
75
|
+
ensure
|
|
76
|
+
@resolving.pop
|
|
77
|
+
end
|
|
78
|
+
return if @cyclic.include?(feature_name)
|
|
79
|
+
|
|
80
|
+
@resolved[feature_name] = Engine.get_feature_flag_result(
|
|
81
|
+
feature, segment_override, @context.dig(:identity, :key), @segment_keys_by_feature_name
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def find_feature(feature_name)
|
|
86
|
+
features = @context[:features]
|
|
87
|
+
return nil unless features
|
|
88
|
+
|
|
89
|
+
features[feature_name] || features[feature_name.to_sym]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def find_segment_override(feature_name)
|
|
93
|
+
segment_override = nil
|
|
94
|
+
@segment_keys_by_feature_name.fetch(feature_name, []).each do |segment_key|
|
|
95
|
+
next unless segment_match?(segment_key)
|
|
96
|
+
|
|
97
|
+
segment = @context[:segments][segment_key]
|
|
98
|
+
segment[:overrides].each do |override|
|
|
99
|
+
next unless override[:name] == feature_name && Engine.wins_over?(override, segment_override&.dig(:feature))
|
|
100
|
+
|
|
101
|
+
segment_override = { feature: override, segment_name: segment[:name] }
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
segment_override
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def segment_match?(segment_key)
|
|
108
|
+
return @segment_matches[segment_key] if @segment_matches.key?(segment_key)
|
|
109
|
+
|
|
110
|
+
cycle_hits = @cycle_hits
|
|
111
|
+
matches = Segments::Evaluator.context_in_segment?(@context, @context[:segments][segment_key])
|
|
112
|
+
return false if @cycle_hits != cycle_hits # Rests on a flag that could not be resolved
|
|
113
|
+
|
|
114
|
+
@segment_matches[segment_key] = matches
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -5,12 +5,12 @@ module Flagsmith
|
|
|
5
5
|
module Mappers
|
|
6
6
|
# Handles identity and override mapping
|
|
7
7
|
module Identity
|
|
8
|
-
def self.
|
|
8
|
+
def self.build_identity_context(identity, override_traits = nil)
|
|
9
9
|
traits = override_traits || identity.identity_traits
|
|
10
10
|
|
|
11
11
|
{
|
|
12
12
|
identifier: identity.identifier,
|
|
13
|
-
key: identity.
|
|
13
|
+
key: identity.composite_key,
|
|
14
14
|
traits: build_traits_hash(traits)
|
|
15
15
|
}
|
|
16
16
|
end
|
|
@@ -11,6 +11,9 @@ module Flagsmith
|
|
|
11
11
|
STRONGEST_PRIORITY = Float::INFINITY
|
|
12
12
|
WEAKEST_PRIORITY = -Float::INFINITY
|
|
13
13
|
|
|
14
|
+
# Condition properties resolvable without an identity
|
|
15
|
+
IDENTITY_FREE_PROPERTY_PREFIXES = ['$.environment.', '$.environment[', '$.flags.', '$.flags['].freeze
|
|
16
|
+
|
|
14
17
|
# @param environment [Flagsmith::Engine::Environment] The environment model
|
|
15
18
|
# @param identity [Flagsmith::Engine::Identity, nil] Optional identity model
|
|
16
19
|
# @param override_traits [Array<Flagsmith::Engine::Identities::Trait>, nil] Optional override traits
|
|
@@ -37,13 +40,41 @@ module Flagsmith
|
|
|
37
40
|
context
|
|
38
41
|
end
|
|
39
42
|
|
|
43
|
+
# Maps environment model to an evaluation context for flags served without an identity
|
|
44
|
+
#
|
|
45
|
+
# @param environment [Flagsmith::Engine::Environment] The environment model
|
|
46
|
+
# @return [Hash] Context with :environment, :features, and the :segments not needing an identity
|
|
47
|
+
def self.get_environment_flags_evaluation_context(environment)
|
|
48
|
+
{
|
|
49
|
+
environment: Environment.build_environment_context(environment),
|
|
50
|
+
features: Environment.build_features_context(environment.feature_states),
|
|
51
|
+
segments: select_identity_free_segments(Segments.build_segments_context(environment.project.segments))
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Selects the segments that can be evaluated without an identity, i.e. reading neither identity nor traits
|
|
56
|
+
#
|
|
57
|
+
# @param segments [Hash] Segments context, keyed by segment key
|
|
58
|
+
# @return [Hash] Segments context without the segments needing an identity
|
|
59
|
+
def self.select_identity_free_segments(segments)
|
|
60
|
+
segments.select { |_, segment| identity_free_rules?(segment[:rules]) }
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def self.identity_free_rules?(rules)
|
|
64
|
+
Array(rules).all? do |rule|
|
|
65
|
+
Array(rule[:conditions]).all? { |condition| condition[:property].to_s.start_with?(*IDENTITY_FREE_PROPERTY_PREFIXES) } &&
|
|
66
|
+
identity_free_rules?(rule[:rules])
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
private_class_method :identity_free_rules?
|
|
70
|
+
|
|
40
71
|
# Maps identity model to identity context
|
|
41
72
|
#
|
|
42
73
|
# @param identity [Flagsmith::Engine::Identity] The identity model
|
|
43
74
|
# @param override_traits [Array<Flagsmith::Engine::Identities::Trait>, nil] Optional override traits
|
|
44
75
|
# @return [Hash] Identity context with :identifier, :key, and :traits
|
|
45
76
|
def self.map_identity_model_to_identity_context(identity, override_traits = nil)
|
|
46
|
-
Identity.
|
|
77
|
+
Identity.build_identity_context(identity, override_traits)
|
|
47
78
|
end
|
|
48
79
|
|
|
49
80
|
# Maps segment rule model to rule hash
|
|
@@ -11,6 +11,9 @@ module Flagsmith
|
|
|
11
11
|
|
|
12
12
|
RULE_TYPES = [ALL_RULE, ANY_RULE, NONE_RULE].freeze
|
|
13
13
|
|
|
14
|
+
# Segment override and variant priority: the lowest wins
|
|
15
|
+
DEFAULT_PRIORITY = Float::INFINITY
|
|
16
|
+
|
|
14
17
|
# Segment Condition Operators
|
|
15
18
|
EQUAL = 'EQUAL'
|
|
16
19
|
GREATER_THAN = 'GREATER_THAN'
|
|
@@ -14,6 +14,9 @@ module Flagsmith
|
|
|
14
14
|
include Flagsmith::Engine::Segments::Constants
|
|
15
15
|
include Flagsmith::Engine::Utils::HashFunc
|
|
16
16
|
|
|
17
|
+
# Compiled JSONPath queries, keyed by condition property
|
|
18
|
+
JSON_PATHS = Hash.new { |json_paths, json_path| json_paths[json_path] = JsonPath.new(json_path, use_symbols: true) }
|
|
19
|
+
|
|
17
20
|
module_function
|
|
18
21
|
|
|
19
22
|
def get_enriched_context(context)
|
|
@@ -36,12 +39,19 @@ module Flagsmith
|
|
|
36
39
|
def get_segments_from_context(context)
|
|
37
40
|
return [] unless context[:identity] && context[:segments]
|
|
38
41
|
|
|
39
|
-
context[:segments].values.select
|
|
40
|
-
|
|
42
|
+
context[:segments].values.select { |segment| context_in_segment?(context, segment) }
|
|
43
|
+
end
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
# Whether the context belongs to a segment, i.e. matches all of its rules
|
|
46
|
+
#
|
|
47
|
+
# @param context [Hash] The evaluation context
|
|
48
|
+
# @param segment [Hash] The segment context
|
|
49
|
+
# @return [Boolean] False for a segment without rules
|
|
50
|
+
def context_in_segment?(context, segment)
|
|
51
|
+
rules = segment[:rules]
|
|
52
|
+
return false if rules.nil? || rules.empty?
|
|
53
|
+
|
|
54
|
+
rules.all? { |rule| traits_match_segment_rule_from_context(rule, segment[:key], context) }
|
|
45
55
|
end
|
|
46
56
|
|
|
47
57
|
def traits_match_segment_condition(identity_traits, condition, segment_id, identity_id)
|
|
@@ -93,7 +103,7 @@ module Flagsmith
|
|
|
93
103
|
end
|
|
94
104
|
|
|
95
105
|
matches_conditions &&
|
|
96
|
-
rule.rules.
|
|
106
|
+
rule.rules.send(rule.matching_function) { |r| traits_match_segment_rule(identity_traits, r, segment_id, identity_id) }
|
|
97
107
|
end
|
|
98
108
|
# rubocop:enable Metrics/MethodLength
|
|
99
109
|
|
|
@@ -137,9 +147,10 @@ module Flagsmith
|
|
|
137
147
|
def evaluate_sub_rules_from_context(rule, segment_key, context)
|
|
138
148
|
return true if rule[:rules].nil? || rule[:rules].empty?
|
|
139
149
|
|
|
140
|
-
rule[:rules].
|
|
150
|
+
sub_rule_results = rule[:rules].map do |sub_rule|
|
|
141
151
|
traits_match_segment_rule_from_context(sub_rule, segment_key, context)
|
|
142
152
|
end
|
|
153
|
+
evaluate_rule_conditions(rule[:type], sub_rule_results)
|
|
143
154
|
end
|
|
144
155
|
|
|
145
156
|
# Evaluates a single segment condition using context
|
|
@@ -157,8 +168,18 @@ module Flagsmith
|
|
|
157
168
|
end
|
|
158
169
|
|
|
159
170
|
def handle_percentage_split(condition, segment_key, context)
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
split_key = if condition[:property].nil? || condition[:property].empty?
|
|
172
|
+
# No property specified - use identity key
|
|
173
|
+
get_identity_key_from_context(context)
|
|
174
|
+
else
|
|
175
|
+
# Property specified - must exist in context
|
|
176
|
+
get_context_value(condition[:property], context)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# If split_key is nil, condition doesn't match
|
|
180
|
+
return false if split_key.nil?
|
|
181
|
+
|
|
182
|
+
hashed_percentage = hashed_percentage_for_object_ids([segment_key, split_key])
|
|
162
183
|
hashed_percentage <= condition[:value].to_f
|
|
163
184
|
end
|
|
164
185
|
|
|
@@ -216,8 +237,7 @@ module Flagsmith
|
|
|
216
237
|
def get_context_value(json_path, context)
|
|
217
238
|
return nil unless context && json_path&.start_with?('$.')
|
|
218
239
|
|
|
219
|
-
|
|
220
|
-
results.first
|
|
240
|
+
JSON_PATHS[json_path].first(context)
|
|
221
241
|
rescue StandardError
|
|
222
242
|
nil
|
|
223
243
|
end
|
|
@@ -42,9 +42,9 @@ module Flagsmith
|
|
|
42
42
|
LESS_THAN => ->(other_value, self_value) { (other_value || false) && other_value < self_value },
|
|
43
43
|
LESS_THAN_INCLUSIVE => ->(other_value, self_value) { (other_value || false) && other_value <= self_value },
|
|
44
44
|
NOT_EQUAL => ->(other_value, self_value) { other_value != self_value },
|
|
45
|
-
CONTAINS => ->(other_value, self_value) { (
|
|
45
|
+
CONTAINS => ->(other_value, self_value) { other_value.is_a?(String) && other_value.include?(self_value) },
|
|
46
46
|
|
|
47
|
-
NOT_CONTAINS => ->(other_value, self_value) { (
|
|
47
|
+
NOT_CONTAINS => ->(other_value, self_value) { other_value.is_a?(String) && !other_value.include?(self_value) },
|
|
48
48
|
REGEX => ->(other_value, self_value) { (other_value || false) && other_value.to_s.match?(self_value) }
|
|
49
49
|
}.freeze
|
|
50
50
|
|
|
@@ -77,6 +77,8 @@ module Flagsmith
|
|
|
77
77
|
type_as_trait_value = format_to_type_of(trait_value)
|
|
78
78
|
formatted_value = type_as_trait_value ? type_as_trait_value.call(@value) : @value
|
|
79
79
|
MATCHING_FUNCTIONS[operator]&.call(trait_value, formatted_value)
|
|
80
|
+
rescue ArgumentError # Rule value not coercible to the trait value's type, e.g. 2 > '1.5'
|
|
81
|
+
false
|
|
80
82
|
end
|
|
81
83
|
|
|
82
84
|
TYPE_CONVERTERS = {
|
|
@@ -84,14 +86,8 @@ module Flagsmith
|
|
|
84
86
|
'Semantic::Version' => ->(v) { Semantic::Version.new(v.to_s.gsub(/:semver$/, '')) },
|
|
85
87
|
'TrueClass' => ->(v) { ['True', 'true', 'TRUE', true, 1, '1'].include?(v) },
|
|
86
88
|
'FalseClass' => ->(v) { !['False', 'false', 'FALSE', false].include?(v) },
|
|
87
|
-
'Integer' =>
|
|
88
|
-
|
|
89
|
-
i.to_s == v.to_s ? i : v
|
|
90
|
-
},
|
|
91
|
-
'Float' => lambda { |v|
|
|
92
|
-
f = v.to_f
|
|
93
|
-
f.to_s == v.to_s ? f : v
|
|
94
|
-
}
|
|
89
|
+
'Integer' => ->(v) { Integer(v.to_s, 10) },
|
|
90
|
+
'Float' => ->(v) { Float(v.to_s) }
|
|
95
91
|
}.freeze
|
|
96
92
|
|
|
97
93
|
def format_to_type_of(input)
|
data/lib/flagsmith/version.rb
CHANGED
data/lib/flagsmith.rb
CHANGED
|
@@ -222,13 +222,12 @@ module Flagsmith
|
|
|
222
222
|
private
|
|
223
223
|
|
|
224
224
|
def environment_flags_from_document # rubocop:disable Metrics/MethodLength
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
unless context
|
|
225
|
+
unless environment
|
|
228
226
|
raise Flagsmith::ClientError,
|
|
229
227
|
'Unable to get flags. No environment present.'
|
|
230
228
|
end
|
|
231
229
|
|
|
230
|
+
context = Flagsmith::Engine::Mappers.get_environment_flags_evaluation_context(environment)
|
|
232
231
|
evaluation_result = Flagsmith::Engine.get_evaluation_result(context)
|
|
233
232
|
|
|
234
233
|
Flagsmith::Flags::Collection.from_evaluation_result(
|
data/renovate.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": ["config:recommended", ":semanticCommitScopeDisabled"],
|
|
4
|
+
"ignorePresets": [":semanticPrefixFixDepsChoreOthers"],
|
|
5
|
+
"semanticCommitType": "deps",
|
|
6
|
+
"git-submodules": { "enabled": true },
|
|
7
|
+
"customManagers": [
|
|
8
|
+
{
|
|
9
|
+
"customType": "regex",
|
|
10
|
+
"managerFilePatterns": ["/^\\.github/workflows/sdk-spec\\.yml$/"],
|
|
11
|
+
"matchStrings": ["spec-ref: (?<currentValue>v[\\d.]+)"],
|
|
12
|
+
"depNameTemplate": "Flagsmith/sdk-spec",
|
|
13
|
+
"datasourceTemplate": "github-tags"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"packageRules": [
|
|
17
|
+
{
|
|
18
|
+
"matchUpdateTypes": [
|
|
19
|
+
"major",
|
|
20
|
+
"minor",
|
|
21
|
+
"patch",
|
|
22
|
+
"digest",
|
|
23
|
+
"pin",
|
|
24
|
+
"rollback",
|
|
25
|
+
"bump",
|
|
26
|
+
"replacement",
|
|
27
|
+
"lockFileMaintenance"
|
|
28
|
+
],
|
|
29
|
+
"enabled": false
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"matchManagers": ["git-submodules"],
|
|
33
|
+
"versioning": "semver-coerced",
|
|
34
|
+
"enabled": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"matchPackageNames": ["Flagsmith/sdk-spec"],
|
|
38
|
+
"groupName": "SDK spec",
|
|
39
|
+
"enabled": true,
|
|
40
|
+
"addLabels": ["sdk-spec"]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flagsmith
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom Stuart
|
|
@@ -12,6 +12,20 @@ bindir: exe
|
|
|
12
12
|
cert_chain: []
|
|
13
13
|
date: 2026-11-23 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: benchmark
|
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
|
18
|
+
requirements:
|
|
19
|
+
- - ">="
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '0'
|
|
22
|
+
type: :development
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '0'
|
|
15
29
|
- !ruby/object:Gem::Dependency
|
|
16
30
|
name: bundler
|
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -40,6 +54,20 @@ dependencies:
|
|
|
40
54
|
- - ">="
|
|
41
55
|
- !ruby/object:Gem::Version
|
|
42
56
|
version: '0'
|
|
57
|
+
- !ruby/object:Gem::Dependency
|
|
58
|
+
name: ostruct
|
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
|
60
|
+
requirements:
|
|
61
|
+
- - ">="
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '0'
|
|
64
|
+
type: :development
|
|
65
|
+
prerelease: false
|
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
67
|
+
requirements:
|
|
68
|
+
- - ">="
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: '0'
|
|
43
71
|
- !ruby/object:Gem::Dependency
|
|
44
72
|
name: pry
|
|
45
73
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -186,8 +214,10 @@ files:
|
|
|
186
214
|
- Gemfile
|
|
187
215
|
- Gemfile.lock
|
|
188
216
|
- LICENCE
|
|
217
|
+
- Makefile
|
|
189
218
|
- README.md
|
|
190
219
|
- Rakefile
|
|
220
|
+
- codspeed.yml
|
|
191
221
|
- lib/flagsmith.rb
|
|
192
222
|
- lib/flagsmith/engine/core.rb
|
|
193
223
|
- lib/flagsmith/engine/environments/models.rb
|
|
@@ -195,6 +225,7 @@ files:
|
|
|
195
225
|
- lib/flagsmith/engine/features/constants.rb
|
|
196
226
|
- lib/flagsmith/engine/features/models.rb
|
|
197
227
|
- lib/flagsmith/engine/identities/models.rb
|
|
228
|
+
- lib/flagsmith/engine/lazy_flags.rb
|
|
198
229
|
- lib/flagsmith/engine/mappers.rb
|
|
199
230
|
- lib/flagsmith/engine/mappers/environment.rb
|
|
200
231
|
- lib/flagsmith/engine/mappers/identity.rb
|
|
@@ -219,6 +250,7 @@ files:
|
|
|
219
250
|
- lib/flagsmith/sdk/utils.rb
|
|
220
251
|
- lib/flagsmith/version.rb
|
|
221
252
|
- release-please-config.json
|
|
253
|
+
- renovate.json
|
|
222
254
|
homepage: https://flagsmith.com
|
|
223
255
|
licenses: []
|
|
224
256
|
metadata:
|