optify-config 0.2.0-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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b6926d0e32d15761aa0b01800098dd9f3353f95c7bb16c45c7a91b424bd27d4c
4
+ data.tar.gz: 03d147998dbeea4dd906ad1a673caec180a7b0ca836f1761f33465950081dfc4
5
+ SHA512:
6
+ metadata.gz: 5c69400a3f00477ada9483146a238934e33398b5537c20aeb72d3607a027a57fadf7bf33b1cfad7f0eb20b72344c3a95c44e78636cd7609008bcb4c763dcfcc1
7
+ data.tar.gz: 94f07c2fecdd4083fda11f743b16169f217056c3411ade73f16d68766f386d877e4a641e8c7e1019d3113788eee45b5f1cad5fe70ceb6ebd7716d43f220f54ab
data/lib/optify.rb ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ # The implementation to use directly Ruby and with types declared.
5
+ require_relative "optify_ruby/implementation"
6
+
7
+
8
+ # The implementation in Rust which redefines some methods.
9
+ # This yields some warnings, but we should redeclare the methods in Ruby to help with type checking anyway.
10
+ # Warnings about redefining methods are normal and can be ignored because the implementations in Ruby are not implemented and only exist to help with type checking.
11
+ require_relative "optify_ruby/optify_ruby"
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+ # typed: strict
3
+
4
+ require 'json'
5
+ require 'ostruct'
6
+
7
+ require 'sorbet-runtime'
8
+
9
+ # Tools for working with configurations declared in files.
10
+ module Optify
11
+ # Provides configurations based on keys and enabled feature names.
12
+ class OptionsProvider
13
+ extend T::Sig
14
+
15
+ # Fetches options in JSON format based on the provided key and feature names.
16
+ #
17
+ # @param key [String] the key to fetch options for.
18
+ # @param feature_names [Array<String>] The enabled feature names to use to build the options.
19
+ # @return [String] the options in JSON.
20
+ sig { params(key: String, feature_names: T::Array[String]).returns(String) }
21
+ def get_options_json(key, feature_names)
22
+ # Implemented in Rust.
23
+ raise NotImplementedError
24
+ end
25
+
26
+ # Fetches options based on the provided key and feature names.
27
+ #
28
+ # @param key [String] the key to fetch options for.
29
+ # @param feature_names [Array<String>] The enabled feature names to use to build the options.
30
+ # @return [OpenStruct] the options.
31
+ sig { params(key: String, feature_names: T::Array[String]).returns(OpenStruct) }
32
+ def get_options(key, feature_names)
33
+ options_json = get_options_json(key, feature_names)
34
+ JSON.parse(options_json, object_class: OpenStruct)
35
+ end
36
+ end
37
+
38
+ # A builder for creating an `OptionsProvider` instance.
39
+ class OptionsProviderBuilder
40
+ extend T::Sig
41
+
42
+ # Adds a directory to the builder.
43
+ #
44
+ # @param path [String] The path of the directory to add.
45
+ # @return [OptionsProviderBuilder] `self`.
46
+ sig { params(path: String).returns(OptionsProviderBuilder) }
47
+ def add_directory(path)
48
+ # Implemented in Rust.
49
+ raise NotImplementedError
50
+ end
51
+
52
+ # @return [OptionsProvider] A newly built `OptionsProvider`.
53
+ sig { returns(OptionsProvider) }
54
+ def build
55
+ # Implemented in Rust.
56
+ raise NotImplementedError
57
+ end
58
+ end
59
+ end
Binary file
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: optify-config
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: x86_64-linux
6
+ authors:
7
+ - Justin D. Harris
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2025-02-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sorbet-runtime
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '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'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake-compiler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.9
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.2.9
41
+ - !ruby/object:Gem::Dependency
42
+ name: sorbet
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: tapioca
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: test-unit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Simplifies getting the right configuration options for a process using
84
+ pre-loaded configurations from files to manage options for experiments or flights.
85
+ email:
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - lib/optify.rb
91
+ - lib/optify_ruby/implementation.rb
92
+ - lib/optify_ruby/optify_ruby.so
93
+ homepage: https://github.com/juharris/optify
94
+ licenses:
95
+ - MIT
96
+ metadata:
97
+ source_code_uri: https://github.com/juharris/optify
98
+ bug_tracker_uri: https://github.com/juharris/optify/issues
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '3.3'
108
+ - - "<"
109
+ - !ruby/object:Gem::Version
110
+ version: 3.4.dev
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ requirements: []
117
+ rubygems_version: 3.5.23
118
+ signing_key:
119
+ specification_version: 4
120
+ summary: Configure your Ruby project using JSON and YAML files that can be combined
121
+ at runtime.
122
+ test_files: []