optify-config 1.16.0-aarch64-linux → 1.17.0-aarch64-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caad24031b483c83a150df0ca0f045e888a59c881f0986932c3f5ea05a214596
4
- data.tar.gz: b0cf125f45c3a2148e29e821f949690a423e535067af9809c3812b384f2a44bc
3
+ metadata.gz: d710b952742abfa40ab4a726ca407cb7ba3802c29cd4614c520a56585fe36081
4
+ data.tar.gz: c7dc5f15f5394cc6ce1fc9b9a04862fdbdc9bc263f901b1b6fd548470e31be6d
5
5
  SHA512:
6
- metadata.gz: 7462dcd80f31b2cfd2e58329fef5cc35c0cd225a45b23424ba3274fb6679d7adbc8eb6dc3769344b6ad03c68d3ae3d11c2d936eb6533fcb9d489998f33873b82
7
- data.tar.gz: cc6bfe47226367d67707f6e18ba17f10fd74e14fa416cf90624c959d2e6cf4579ef0447476e08e7961a107def04dab0c2579a129f999f3ca535a14e7657125aa
6
+ metadata.gz: 4d4534c2966cfa5c06915ef79dc794ef3a71a8132c714a5d191c4e34a8110a5c41d5969eb8489e6db082db0ea9057e3a683577cf939e297084acaf1656044c96
7
+ data.tar.gz: 98df67de993e58a5adaa028111192985402e3be73e0b2490cf506fdb39158b15d829309e1af8e74b50870325fe78301cb5fbfb28230c73eac93cb59e4ddf7255
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 that so that it can set members with private setters.
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
- sig = T::Utils.signature_for_method(instance_method(key))
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
- cache_key = [key, feature_names, config_class]
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,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optify-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.17.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Justin D. Harris
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-05 00:00:00.000000000 Z
11
+ date: 2025-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.5'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 0.6.12477
22
+ version: '1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.5'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 0.6.12477
32
+ version: '1'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake-compiler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +62,22 @@ dependencies:
56
62
  name: sorbet
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - "~>"
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0.5'
68
+ - - "<"
60
69
  - !ruby/object:Gem::Version
61
- version: 0.6.12477
70
+ version: '1'
62
71
  type: :development
63
72
  prerelease: false
64
73
  version_requirements: !ruby/object:Gem::Requirement
65
74
  requirements:
66
- - - "~>"
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0.5'
78
+ - - "<"
67
79
  - !ruby/object:Gem::Version
68
- version: 0.6.12477
80
+ version: '1'
69
81
  - !ruby/object:Gem::Dependency
70
82
  name: tapioca
71
83
  requirement: !ruby/object:Gem::Requirement