optify-config 1.17.6-x86_64-linux → 1.17.8-x86_64-linux
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 -1
- data/lib/optify_ruby/3.2/optify_ruby.so +0 -0
- data/lib/optify_ruby/3.3/optify_ruby.so +0 -0
- data/lib/optify_ruby/3.4/optify_ruby.so +0 -0
- data/lib/optify_ruby/get_options_preferences.rb +1 -1
- data/lib/optify_ruby/implementation.rb +1 -1
- data/lib/optify_ruby/options_metadata.rb +1 -1
- data/lib/optify_ruby/provider_module.rb +21 -24
- data/lib/optify_ruby/watcher_implementation.rb +1 -1
- data/rbi/optify.rbi +28 -1
- data/sig/optify.rbs +11 -0
- metadata +44 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 980ce754cfedbf19f9ec35dc79b6c8657b387159dc3fb355f241ab61f0900be8
|
|
4
|
+
data.tar.gz: d2ca657a821d295ee73dea426c03cf6abf0eba28c69bbdfe6a0a8e4faa4e6d7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a722201e8447ee0f88a35fc2f8f8bfa010d8ff32e79d2d89721ed9e39115b5a32bdf09ec5ea8e2ca9e1b426a6ee04ae87c9a90f571d950d37fef0fae85fb6b6
|
|
7
|
+
data.tar.gz: 036bf2cfefbe424c4ddf5d34c094401a444e338701729de1dbc24532dc27e848407f30a1f276f38df798d69c2fe0360f22358896e5bf1f49559464290a25ef95
|
data/lib/optify.rb
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
1
|
# typed: strict
|
|
2
|
+
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
+
require 'json'
|
|
4
5
|
require 'sorbet-runtime'
|
|
5
6
|
|
|
6
7
|
module Optify
|
|
@@ -52,7 +53,7 @@ module Optify
|
|
|
52
53
|
# @param cache_options Set this if caching is desired. Only very simple caching is supported for now.
|
|
53
54
|
# @param preferences The preferences to use when getting options.
|
|
54
55
|
# @return The options.
|
|
55
|
-
#: [Config] (String
|
|
56
|
+
#: [Config] (String, Array[String], Class[Config], ?CacheOptions?, ?Optify::GetOptionsPreferences?) -> Config
|
|
56
57
|
def _get_options(key, feature_names, config_class, cache_options = nil, preferences = nil)
|
|
57
58
|
return get_options_with_cache(key, feature_names, config_class, cache_options, preferences) if cache_options
|
|
58
59
|
|
|
@@ -63,12 +64,11 @@ module Optify
|
|
|
63
64
|
Recommended: extend `Optify::FromHashable`."
|
|
64
65
|
end
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
hash = JSON.parse(options_json)
|
|
67
|
+
hash = if preferences
|
|
68
|
+
get_options_hash_with_preferences(key, feature_names, preferences)
|
|
69
|
+
else
|
|
70
|
+
get_options_hash(key, feature_names)
|
|
71
|
+
end
|
|
72
72
|
config_class #: as untyped
|
|
73
73
|
.from_hash(hash)
|
|
74
74
|
end
|
|
@@ -79,8 +79,6 @@ module Optify
|
|
|
79
79
|
@features_with_metadata = nil #: Hash[String, OptionsMetadata]?
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
NOT_FOUND_IN_CACHE_SENTINEL = Object.new
|
|
83
|
-
|
|
84
82
|
#: [Config] (String key, Array[String] feature_names, Class[Config] config_class, Optify::CacheOptions _cache_options, ?Optify::GetOptionsPreferences? preferences) -> Config
|
|
85
83
|
def get_options_with_cache(key, feature_names, config_class, _cache_options, preferences = nil)
|
|
86
84
|
# Cache directly in Ruby instead of Rust because:
|
|
@@ -102,23 +100,22 @@ module Optify
|
|
|
102
100
|
# Features are filtered, so we don't need the constraints in the cache key.
|
|
103
101
|
are_configurable_strings_enabled = preferences&.are_configurable_strings_enabled? || false
|
|
104
102
|
cache_key = [key, feature_names, are_configurable_strings_enabled, config_class]
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
# Handle a cache miss.
|
|
103
|
+
@cache #: as !nil
|
|
104
|
+
.fetch(cache_key) do
|
|
105
|
+
# Handle a cache miss.
|
|
110
106
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
# We can avoid converting the features names because they're already converted from filtering above, if that was desired.
|
|
108
|
+
# We don't need the constraints because we filtered the features above.
|
|
109
|
+
# We already know there are no overrides because we checked above.
|
|
110
|
+
preferences = GetOptionsPreferences.new
|
|
111
|
+
preferences.skip_feature_name_conversion = true
|
|
112
|
+
preferences.enable_configurable_strings if are_configurable_strings_enabled
|
|
117
113
|
|
|
118
|
-
|
|
114
|
+
result = get_options(key, feature_names, config_class, nil, preferences)
|
|
119
115
|
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
@cache #: as !nil
|
|
117
|
+
.[]= cache_key, result
|
|
118
|
+
end
|
|
122
119
|
end
|
|
123
120
|
end
|
|
124
121
|
end
|
data/rbi/optify.rbi
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
1
|
# typed: strong
|
|
2
|
+
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
# Tools for working with configurations declared in files.
|
|
5
5
|
module Optify
|
|
@@ -142,6 +142,13 @@ module Optify
|
|
|
142
142
|
sig { returns(T::Hash[String, OptionsMetadata]) }
|
|
143
143
|
def features_with_metadata; end
|
|
144
144
|
|
|
145
|
+
# @return All of the keys and values for the the features.
|
|
146
|
+
sig do
|
|
147
|
+
params(feature_names: T::Array[String], preferences: GetOptionsPreferences)
|
|
148
|
+
.returns(T::Hash[String, T.untyped])
|
|
149
|
+
end
|
|
150
|
+
def get_all_options_hash(feature_names, preferences); end
|
|
151
|
+
|
|
145
152
|
# @return All of the keys and values for the the features.
|
|
146
153
|
sig do
|
|
147
154
|
params(feature_names: T::Array[String], preferences: GetOptionsPreferences)
|
|
@@ -210,6 +217,26 @@ module Optify
|
|
|
210
217
|
end
|
|
211
218
|
def get_options(key, feature_names, config_class, cache_options = nil, preferences = nil); end
|
|
212
219
|
|
|
220
|
+
# Fetches options based on the provided key and feature names.
|
|
221
|
+
#
|
|
222
|
+
# @param key [String] the key to fetch options for.
|
|
223
|
+
# @param feature_names [Array<String>] The enabled feature names to use to build the options.
|
|
224
|
+
# @return [Hash[String, T.untyped]] the options.
|
|
225
|
+
sig { params(key: String, feature_names: T::Array[String]).returns(T::Hash[String, T.untyped]) }
|
|
226
|
+
def get_options_hash(key, feature_names); end
|
|
227
|
+
|
|
228
|
+
# Fetches options based on the provided key and feature names.
|
|
229
|
+
#
|
|
230
|
+
# @param key [String] the key to fetch options for.
|
|
231
|
+
# @param feature_names [Array<String>] The enabled feature names to use to build the options.
|
|
232
|
+
# @param preferences [GetOptionsPreferences] The preferences to use when getting options.
|
|
233
|
+
# @return [String] the options in JSON.
|
|
234
|
+
sig do
|
|
235
|
+
params(key: String, feature_names: T::Array[String], preferences: GetOptionsPreferences)
|
|
236
|
+
.returns(T::Hash[String, T.untyped])
|
|
237
|
+
end
|
|
238
|
+
def get_options_hash_with_preferences(key, feature_names, preferences); end
|
|
239
|
+
|
|
213
240
|
# Fetches options in JSON format based on the provided key and feature names.
|
|
214
241
|
#
|
|
215
242
|
# @param key [String] the key to fetch options for.
|
data/sig/optify.rbs
CHANGED
|
@@ -110,6 +110,8 @@ class Optify::OptionsRegistry
|
|
|
110
110
|
# @return All of the keys and values for the the features.
|
|
111
111
|
def features_with_metadata: () -> ::Hash[String, OptionsMetadata]
|
|
112
112
|
|
|
113
|
+
def get_all_options_hash: (::Array[String] feature_names, GetOptionsPreferences preferences) -> ::Hash[String, untyped]
|
|
114
|
+
|
|
113
115
|
def get_all_options_json: (::Array[String] feature_names, GetOptionsPreferences preferences) -> String
|
|
114
116
|
end
|
|
115
117
|
|
|
@@ -139,6 +141,15 @@ module Optify::ProviderModule
|
|
|
139
141
|
|
|
140
142
|
def get_options: [Config] (String key, ::Array[String] feature_names, T::Class[Config] config_class, ?CacheOptions? cache_options, ?Optify::GetOptionsPreferences? preferences) -> Config
|
|
141
143
|
|
|
144
|
+
# Fetches options based on the provided key and feature names.
|
|
145
|
+
#
|
|
146
|
+
# @param key [String] the key to fetch options for.
|
|
147
|
+
# @param feature_names [Array<String>] The enabled feature names to use to build the options.
|
|
148
|
+
# @return [Hash[String, T.untyped]] the options.
|
|
149
|
+
def get_options_hash: (String key, ::Array[String] feature_names) -> ::Hash[String, untyped]
|
|
150
|
+
|
|
151
|
+
def get_options_hash_with_preferences: (String key, ::Array[String] feature_names, GetOptionsPreferences preferences) -> ::Hash[String, untyped]
|
|
152
|
+
|
|
142
153
|
# Fetches options in JSON format based on the provided key and feature names.
|
|
143
154
|
#
|
|
144
155
|
# @param key [String] the key to fetch options for.
|
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: optify-config
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.17.
|
|
4
|
+
version: 1.17.8
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Justin D. Harris
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: optify-from_hash
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.2.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.2.0
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: sorbet-runtime
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,6 +72,34 @@ dependencies:
|
|
|
58
72
|
- - "~>"
|
|
59
73
|
- !ruby/object:Gem::Version
|
|
60
74
|
version: 4.0.0.dev.4
|
|
75
|
+
- !ruby/object:Gem::Dependency
|
|
76
|
+
name: rubocop
|
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: 1.76.1
|
|
82
|
+
type: :development
|
|
83
|
+
prerelease: false
|
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - "~>"
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: 1.76.1
|
|
89
|
+
- !ruby/object:Gem::Dependency
|
|
90
|
+
name: rubocop-sorbet
|
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - "~>"
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: 0.11.0
|
|
96
|
+
type: :development
|
|
97
|
+
prerelease: false
|
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - "~>"
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: 0.11.0
|
|
61
103
|
- !ruby/object:Gem::Dependency
|
|
62
104
|
name: sorbet
|
|
63
105
|
requirement: !ruby/object:Gem::Requirement
|