optify-config 0.2.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 +7 -0
- data/lib/optify.rb +11 -0
- data/lib/optify_ruby/implementation.rb +59 -0
- data/lib/optify_ruby/optify_ruby.bundle +0 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e9bcc3e32a980adba05b57096383674f054ce3e07ea8e604b1939f67e5d0859f
|
4
|
+
data.tar.gz: 9e9f2066c6de75d34c246161f9b89f74fa1a7743a1aef05137b79a51ee3ffa39
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5bc751937763946708a2fee1d71b1c1c6a4068c2550956df0da63d7a83489ef1fc9beb652f75ae5e228c11c637e2fb7b68916cd0cba10836bcf225b7d898ca84
|
7
|
+
data.tar.gz: 281d2a5ecb71670e525a945b751eedf01c0d66fb8678cd433b5743ef8a1b0c82397ca51884bbdbe91a80b1b0e34a3be7d4a298d77a5599a41fb914657bf8b335
|
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: arm64-darwin
|
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.bundle
|
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: []
|