optify-config 1.3.1-arm64-darwin → 1.4.0-arm64-darwin
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/optify.rb +1 -0
- data/lib/optify_ruby/3.2/optify_ruby.bundle +0 -0
- data/lib/optify_ruby/3.4/optify_ruby.bundle +0 -0
- data/lib/optify_ruby/get_options_preferences.rb +13 -0
- data/lib/optify_ruby/provider_module.rb +6 -0
- data/rbi/optify.rbi +18 -1
- data/sig/optify.rbs +14 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8018ef50ae10f20a6697b078f476cab8cbc3b16e732c835ef0d61977758bbcfd
|
4
|
+
data.tar.gz: d7c3016a5391eb23f9b268d39ddc3672594d0bb9b92df41c4107151c3ef03289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25a57e9395f136e20ecded59060653511a622264e49234b6b977368508e6edd7614b3b18cff85c070912b6c1f4867ccc8af2de6b1a9a7feed72a0dcb1709916d
|
7
|
+
data.tar.gz: fd5503dcd1cada4c68bb9263c7214793f58364b6509a0fac8416ca86dc58845e105c2f5ececd14029436607a4feb1bdf8022795ee3c602e60c41adad16ae9ee9
|
data/lib/optify.rb
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: strict
|
3
|
+
|
4
|
+
module Optify
|
5
|
+
# Preferences for `get_options`.
|
6
|
+
class GetOptionsPreferences
|
7
|
+
# @param overrides [Hash]
|
8
|
+
#: (Hash[untyped, untyped] overrides) -> void
|
9
|
+
def overrides=(overrides)
|
10
|
+
self.overrides_json = overrides.to_json
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -87,6 +87,11 @@ module Optify
|
|
87
87
|
# Cache directly in Ruby instead of Rust because:
|
88
88
|
# * Avoid any possible conversion overhead.
|
89
89
|
# * Memory management: probably better to do it in Ruby for a Ruby app and avoid memory in Rust.
|
90
|
+
if preferences&.overrides?
|
91
|
+
Kernel.raise ArgumentError,
|
92
|
+
'Caching when overrides are given is not supported. Do not pass cache options when using overrides in preferences.'
|
93
|
+
end
|
94
|
+
|
90
95
|
init unless @cache
|
91
96
|
unless preferences&.skip_feature_name_conversion
|
92
97
|
# When there are just a few names, then it can be faster to convert them one by one in a loop to avoid working with an array in Rust.
|
@@ -98,6 +103,7 @@ module Optify
|
|
98
103
|
result = @cache&.fetch(cache_key, NOT_FOUND_IN_CACHE_SENTINEL)
|
99
104
|
return result unless result.equal?(NOT_FOUND_IN_CACHE_SENTINEL)
|
100
105
|
|
106
|
+
# TODO: Copy the preferences to avoid mutating the original object.
|
101
107
|
preferences ||= GetOptionsPreferences.new
|
102
108
|
preferences.skip_feature_name_conversion = true
|
103
109
|
result = get_options(key, feature_names, config_class, nil, preferences)
|
data/rbi/optify.rbi
CHANGED
@@ -43,8 +43,25 @@ module Optify
|
|
43
43
|
|
44
44
|
# Preferences when getting options.
|
45
45
|
class GetOptionsPreferences
|
46
|
-
|
46
|
+
# Indicates if overrides are set.
|
47
|
+
sig { returns(T::Boolean) }
|
48
|
+
def overrides?; end
|
49
|
+
|
50
|
+
# Set overrides to apply after building the options based on the feature names.
|
51
|
+
# Do not provide overrides when requesting cached options.
|
52
|
+
# @param value The overrides to apply.
|
53
|
+
sig { params(value: T.nilable(T::Hash[T.untyped, T.untyped])).void }
|
54
|
+
def overrides=(value); end
|
55
|
+
|
56
|
+
# Set overrides to apply after building the options based on the feature names.
|
57
|
+
# Do not provide overrides when requesting cached options.
|
58
|
+
# @param value The overrides to apply as serialized JSON.
|
59
|
+
sig { params(value: T.nilable(String)).void }
|
60
|
+
def overrides_json=(value); end
|
61
|
+
|
62
|
+
sig { params(value: T::Boolean).void }
|
47
63
|
def skip_feature_name_conversion=(value); end
|
64
|
+
|
48
65
|
sig { returns(T::Boolean) }
|
49
66
|
def skip_feature_name_conversion; end
|
50
67
|
end
|
data/sig/optify.rbs
CHANGED
@@ -35,7 +35,20 @@ end
|
|
35
35
|
|
36
36
|
# Preferences when getting options.
|
37
37
|
class Optify::GetOptionsPreferences
|
38
|
-
|
38
|
+
# Indicates if overrides are set.
|
39
|
+
def overrides?: () -> bool
|
40
|
+
|
41
|
+
# Set overrides to apply after building the options based on the feature names.
|
42
|
+
# Do not provide overrides when requesting cached options.
|
43
|
+
# @param value The overrides to apply.
|
44
|
+
def overrides=: (::Hash[untyped, untyped]? value) -> void
|
45
|
+
|
46
|
+
# Set overrides to apply after building the options based on the feature names.
|
47
|
+
# Do not provide overrides when requesting cached options.
|
48
|
+
# @param value The overrides to apply as serialized JSON.
|
49
|
+
def overrides_json=: (String? value) -> void
|
50
|
+
|
51
|
+
def skip_feature_name_conversion=: (bool value) -> void
|
39
52
|
|
40
53
|
def skip_feature_name_conversion: () -> bool
|
41
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: optify-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: arm64-darwin
|
6
6
|
authors:
|
7
7
|
- Justin D. Harris
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/optify_ruby/3.2/optify_ruby.bundle
|
107
107
|
- lib/optify_ruby/3.4/optify_ruby.bundle
|
108
108
|
- lib/optify_ruby/base_config.rb
|
109
|
+
- lib/optify_ruby/get_options_preferences.rb
|
109
110
|
- lib/optify_ruby/implementation.rb
|
110
111
|
- lib/optify_ruby/options_metadata.rb
|
111
112
|
- lib/optify_ruby/provider_module.rb
|