optify-config 1.3.1-aarch64-linux → 1.4.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 +4 -4
 - data/lib/optify.rb +1 -0
 - data/lib/optify_ruby/3.2/optify_ruby.so +0 -0
 - data/lib/optify_ruby/3.4/optify_ruby.so +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: ee9608bcf6f34b261c29bc086aa954a08a3069191e30fa75fb589974c123a442
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b04a92bf2b0486ba01191c57add0b60052cf1825a5905b012ed2e55ac4d69a32
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1c17f95295d880ba8681cf9f2d2680f5844e2ce0a64ea2c2ac2c4ed00daad7605a4e620c60eea958ae723902b05eb7594544332baaa7e15eb8ead2a782e6d94f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e9b05e0f634d59ea0100949632ffc9246b0d197a01445e4d860dd9510a87c3d73aa43fc365e2cdb448badee9843b0e464bcfa2075980e1731ae8b8f1ddf5eb9d
         
     | 
    
        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: aarch64-linux
         
     | 
| 
       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.so
         
     | 
| 
       107 
107 
     | 
    
         
             
            - lib/optify_ruby/3.4/optify_ruby.so
         
     | 
| 
       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
         
     |