optify-config 1.16.1-arm64-darwin → 1.17.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_ruby/3.2/optify_ruby.bundle +0 -0
- data/lib/optify_ruby/3.4/optify_ruby.bundle +0 -0
- data/lib/optify_ruby/base_config.rb +8 -2
- data/lib/optify_ruby/provider_module.rb +2 -1
- data/rbi/optify.rbi +13 -0
- data/sig/optify.rbs +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d11cd62057315ed54e6b5088e65d740314495c4885354c4a2e07ab80e9922595
|
4
|
+
data.tar.gz: 0d77c856d969fde6e55685d5e5a6ef15442003d99243dc11bada8da126fff1b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5935e6bd0deb3a5afb96b700c2edf4ba941b2707ac5fbaad231b5922b152258751992683938228d1d1ad2c2c1c8600e8b3dcbb680cb73a3f110368f5d3571abd
|
7
|
+
data.tar.gz: 383c0226c882e26c65c35c253d7f5915c3eb41be635b698f49963ca82c80844f4b2356dbb50dc5ae22e7f19f47054b449603578fc2b9fa73b6b550a4dbf184c8
|
Binary file
|
Binary file
|
@@ -17,7 +17,7 @@ module Optify
|
|
17
17
|
|
18
18
|
# Create a new immutable instance of the class from a hash.
|
19
19
|
#
|
20
|
-
# This is a class method
|
20
|
+
# This is a class method so that it can set members with private setters.
|
21
21
|
# @param hash The hash to create the instance from.
|
22
22
|
# @return The new instance.
|
23
23
|
#: (Hash[untyped, untyped] hash) -> instance
|
@@ -25,7 +25,13 @@ module Optify
|
|
25
25
|
instance = new
|
26
26
|
|
27
27
|
hash.each do |key, value|
|
28
|
-
|
28
|
+
begin
|
29
|
+
method = instance_method(key)
|
30
|
+
rescue StandardError
|
31
|
+
raise ArgumentError, "Error converting hash to `#{name}` because of key \"#{key}\". Perhaps \"#{key}\" is not a valid attribute for `#{name}`."
|
32
|
+
end
|
33
|
+
|
34
|
+
sig = T::Utils.signature_for_method(method)
|
29
35
|
raise "A Sorbet signature is required for `#{name}.#{key}`." if sig.nil?
|
30
36
|
|
31
37
|
sig_return_type = sig.return_type
|
@@ -100,7 +100,8 @@ module Optify
|
|
100
100
|
end
|
101
101
|
|
102
102
|
# Features are filtered, so we don't need the constraints in the cache key.
|
103
|
-
|
103
|
+
are_configurable_strings_enabled = preferences&.are_configurable_strings_enabled? || false
|
104
|
+
cache_key = [key, feature_names, are_configurable_strings_enabled, config_class]
|
104
105
|
result = @cache #: as !nil
|
105
106
|
.fetch(cache_key, NOT_FOUND_IN_CACHE_SENTINEL)
|
106
107
|
return result unless result.equal?(NOT_FOUND_IN_CACHE_SENTINEL)
|
data/rbi/optify.rbi
CHANGED
@@ -64,6 +64,19 @@ module Optify
|
|
64
64
|
|
65
65
|
# Preferences when getting options.
|
66
66
|
class GetOptionsPreferences
|
67
|
+
# Indicates if configurable strings are enabled.
|
68
|
+
# They are disabled by default.
|
69
|
+
sig { returns(T::Boolean) }
|
70
|
+
def are_configurable_strings_enabled?; end
|
71
|
+
|
72
|
+
# Disable configurable strings which default to disabled.
|
73
|
+
sig { void }
|
74
|
+
def disable_configurable_strings; end
|
75
|
+
|
76
|
+
# Enable configurable strings which default to disabled.
|
77
|
+
sig { void }
|
78
|
+
def enable_configurable_strings; end
|
79
|
+
|
67
80
|
# Set constraints for the current request to limit the features that can be enabled.
|
68
81
|
sig { params(value: T.nilable(T::Hash[T.untyped, T.untyped])).void }
|
69
82
|
def constraints=(value); end
|
data/sig/optify.rbs
CHANGED
@@ -52,6 +52,16 @@ end
|
|
52
52
|
|
53
53
|
# Preferences when getting options.
|
54
54
|
class Optify::GetOptionsPreferences
|
55
|
+
# Indicates if configurable strings are enabled.
|
56
|
+
# They are disabled by default.
|
57
|
+
def are_configurable_strings_enabled?: () -> bool
|
58
|
+
|
59
|
+
# Disable configurable strings which default to disabled.
|
60
|
+
def disable_configurable_strings: () -> void
|
61
|
+
|
62
|
+
# Enable configurable strings which default to disabled.
|
63
|
+
def enable_configurable_strings: () -> void
|
64
|
+
|
55
65
|
# Set constraints for the current request to limit the features that can be enabled.
|
56
66
|
def constraints=: (::Hash[untyped, untyped]? value) -> void
|
57
67
|
|
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.17.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-
|
11
|
+
date: 2025-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|