roast-ai 0.4.3 → 0.4.5
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/.github/CODEOWNERS +2 -0
- data/.github/workflows/ci.yaml +1 -0
- data/.gitignore +0 -26
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +21 -0
- data/CHANGELOG.md +29 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +47 -29
- data/bin/rubocop +27 -0
- data/bin/spoom +27 -0
- data/bin/srb +27 -0
- data/bin/srb-rbi +27 -0
- data/bin/tapioca +27 -0
- data/docs/INSTRUMENTATION.md +3 -3
- data/dsl/simple.rb +10 -0
- data/lib/roast/dsl/executor.rb +26 -0
- data/lib/roast/dsl.rb +7 -0
- data/lib/roast/errors.rb +1 -0
- data/lib/roast/factories/api_provider_factory.rb +1 -0
- data/lib/roast/helpers/function_caching_interceptor.rb +3 -0
- data/lib/roast/helpers/logger.rb +6 -9
- data/lib/roast/helpers/metadata_access.rb +1 -0
- data/lib/roast/helpers/minitest_coverage_runner.rb +1 -0
- data/lib/roast/helpers/path_resolver.rb +8 -18
- data/lib/roast/helpers/prompt_loader.rb +3 -2
- data/lib/roast/helpers/timeout_handler.rb +3 -5
- data/lib/roast/initializers.rb +1 -0
- data/lib/roast/resources/api_resource.rb +4 -3
- data/lib/roast/resources/base_resource.rb +1 -0
- data/lib/roast/resources/directory_resource.rb +1 -0
- data/lib/roast/resources/file_resource.rb +1 -0
- data/lib/roast/resources/none_resource.rb +1 -0
- data/lib/roast/resources/url_resource.rb +2 -1
- data/lib/roast/resources.rb +1 -2
- data/lib/roast/services/context_threshold_checker.rb +1 -0
- data/lib/roast/services/token_counting_service.rb +1 -0
- data/lib/roast/tools/apply_diff.rb +1 -0
- data/lib/roast/tools/ask_user.rb +1 -0
- data/lib/roast/tools/bash.rb +1 -0
- data/lib/roast/tools/cmd.rb +1 -0
- data/lib/roast/tools/coding_agent.rb +1 -0
- data/lib/roast/tools/context_summarizer.rb +1 -0
- data/lib/roast/tools/grep.rb +1 -0
- data/lib/roast/tools/helpers/coding_agent_message_formatter.rb +1 -0
- data/lib/roast/tools/read_file.rb +1 -0
- data/lib/roast/tools/search_file.rb +1 -0
- data/lib/roast/tools/swarm.rb +1 -0
- data/lib/roast/tools/update_files.rb +1 -0
- data/lib/roast/tools/write_file.rb +1 -0
- data/lib/roast/tools.rb +2 -0
- data/lib/roast/value_objects/api_token.rb +1 -0
- data/lib/roast/value_objects/step_name.rb +1 -0
- data/lib/roast/value_objects/uri_base.rb +1 -0
- data/lib/roast/value_objects/workflow_path.rb +1 -0
- data/lib/roast/value_objects.rb +1 -0
- data/lib/roast/version.rb +2 -1
- data/lib/roast/workflow/agent_step.rb +1 -0
- data/lib/roast/workflow/api_configuration.rb +1 -0
- data/lib/roast/workflow/base_iteration_step.rb +1 -0
- data/lib/roast/workflow/base_step.rb +1 -0
- data/lib/roast/workflow/base_workflow.rb +1 -0
- data/lib/roast/workflow/case_executor.rb +1 -0
- data/lib/roast/workflow/case_step.rb +1 -0
- data/lib/roast/workflow/command_executor.rb +1 -0
- data/lib/roast/workflow/conditional_executor.rb +1 -0
- data/lib/roast/workflow/conditional_step.rb +1 -0
- data/lib/roast/workflow/configuration.rb +9 -0
- data/lib/roast/workflow/configuration_loader.rb +4 -1
- data/lib/roast/workflow/context_manager.rb +1 -0
- data/lib/roast/workflow/context_path_resolver.rb +1 -0
- data/lib/roast/workflow/dot_access_hash.rb +1 -0
- data/lib/roast/workflow/each_step.rb +1 -0
- data/lib/roast/workflow/error_handler.rb +7 -1
- data/lib/roast/workflow/expression_evaluator.rb +1 -0
- data/lib/roast/workflow/expression_utils.rb +1 -0
- data/lib/roast/workflow/file_state_repository.rb +2 -1
- data/lib/roast/workflow/input_executor.rb +1 -0
- data/lib/roast/workflow/input_step.rb +1 -0
- data/lib/roast/workflow/interpolator.rb +2 -1
- data/lib/roast/workflow/iteration_executor.rb +1 -0
- data/lib/roast/workflow/llm_boolean_coercer.rb +1 -0
- data/lib/roast/workflow/metadata_manager.rb +1 -0
- data/lib/roast/workflow/output_handler.rb +1 -0
- data/lib/roast/workflow/output_manager.rb +1 -0
- data/lib/roast/workflow/parallel_executor.rb +1 -0
- data/lib/roast/workflow/prompt_step.rb +1 -0
- data/lib/roast/workflow/repeat_step.rb +1 -0
- data/lib/roast/workflow/replay_handler.rb +1 -0
- data/lib/roast/workflow/resource_resolver.rb +2 -6
- data/lib/roast/workflow/session_manager.rb +1 -0
- data/lib/roast/workflow/shell_script_step.rb +1 -0
- data/lib/roast/workflow/sqlite_state_repository.rb +1 -0
- data/lib/roast/workflow/state_manager.rb +1 -0
- data/lib/roast/workflow/state_repository.rb +1 -0
- data/lib/roast/workflow/state_repository_factory.rb +4 -2
- data/lib/roast/workflow/step_completion_reporter.rb +1 -0
- data/lib/roast/workflow/step_executor_coordinator.rb +9 -5
- data/lib/roast/workflow/step_executor_factory.rb +1 -0
- data/lib/roast/workflow/step_executor_registry.rb +2 -3
- data/lib/roast/workflow/step_executor_with_reporting.rb +1 -0
- data/lib/roast/workflow/step_executors/base_step_executor.rb +1 -0
- data/lib/roast/workflow/step_executors/hash_step_executor.rb +1 -0
- data/lib/roast/workflow/step_executors/parallel_step_executor.rb +1 -0
- data/lib/roast/workflow/step_executors/string_step_executor.rb +1 -0
- data/lib/roast/workflow/step_factory.rb +1 -0
- data/lib/roast/workflow/step_finder.rb +1 -0
- data/lib/roast/workflow/step_loader.rb +1 -0
- data/lib/roast/workflow/step_name_extractor.rb +1 -0
- data/lib/roast/workflow/step_runner.rb +1 -0
- data/lib/roast/workflow/step_type_resolver.rb +1 -0
- data/lib/roast/workflow/validation_command.rb +1 -0
- data/lib/roast/workflow/validator.rb +1 -0
- data/lib/roast/workflow/validators/base_validator.rb +1 -0
- data/lib/roast/workflow/validators/dependency_validator.rb +1 -0
- data/lib/roast/workflow/validators/linting_validator.rb +1 -0
- data/lib/roast/workflow/validators/schema_validator.rb +1 -0
- data/lib/roast/workflow/validators/step_collector.rb +1 -0
- data/lib/roast/workflow/validators/validation_orchestrator.rb +1 -0
- data/lib/roast/workflow/workflow_context.rb +1 -0
- data/lib/roast/workflow/workflow_execution_context.rb +1 -0
- data/lib/roast/workflow/workflow_executor.rb +2 -1
- data/lib/roast/workflow/workflow_initializer.rb +1 -0
- data/lib/roast/workflow/workflow_runner.rb +66 -55
- data/lib/roast/workflow.rb +1 -0
- data/lib/roast/workflow_diagram_generator.rb +3 -2
- data/lib/roast.rb +23 -8
- data/roast.gemspec +1 -1
- data/sorbet/config +8 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/activesupport@8.0.2.rbi +19107 -0
- data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
- data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
- data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
- data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +62 -0
- data/sorbet/rbi/gems/cgi@0.5.0.rbi +2961 -0
- data/sorbet/rbi/gems/claude_swarm@0.1.19.rbi +568 -0
- data/sorbet/rbi/gems/cli-kit@5.0.1.rbi +1991 -0
- data/sorbet/rbi/gems/cli-ui@2.3.0.rbi +3181 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +9 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11657 -0
- data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
- data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
- data/sorbet/rbi/gems/diff-lcs@1.6.2.rbi +972 -0
- data/sorbet/rbi/gems/dotenv@3.1.8.rbi +295 -0
- data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
- data/sorbet/rbi/gems/dry-configurable@1.3.0.rbi +672 -0
- data/sorbet/rbi/gems/dry-core@1.1.0.rbi +1894 -0
- data/sorbet/rbi/gems/dry-inflector@1.2.0.rbi +659 -0
- data/sorbet/rbi/gems/dry-initializer@3.2.0.rbi +781 -0
- data/sorbet/rbi/gems/dry-logic@1.6.0.rbi +1127 -0
- data/sorbet/rbi/gems/dry-schema@1.14.1.rbi +3727 -0
- data/sorbet/rbi/gems/dry-types@1.8.3.rbi +3969 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/event_stream_parser@1.0.0.rbi +49 -0
- data/sorbet/rbi/gems/faraday-multipart@1.1.1.rbi +283 -0
- data/sorbet/rbi/gems/faraday-net_http@3.4.1.rbi +147 -0
- data/sorbet/rbi/gems/faraday-retry@2.3.2.rbi +9 -0
- data/sorbet/rbi/gems/faraday@2.13.1.rbi +2977 -0
- data/sorbet/rbi/gems/fast-mcp-annotations@1.5.3.rbi +1588 -0
- data/sorbet/rbi/gems/ffi@1.17.2.rbi +9 -0
- data/sorbet/rbi/gems/formatador@1.1.0.rbi +9 -0
- data/sorbet/rbi/gems/guard-compat@1.2.1.rbi +102 -0
- data/sorbet/rbi/gems/guard-minitest@2.4.6.rbi +402 -0
- data/sorbet/rbi/gems/guard@2.19.1.rbi +2283 -0
- data/sorbet/rbi/gems/hashdiff@1.2.0.rbi +355 -0
- data/sorbet/rbi/gems/i18n@1.14.7.rbi +2359 -0
- data/sorbet/rbi/gems/json-schema@5.1.1.rbi +1466 -0
- data/sorbet/rbi/gems/json@2.12.2.rbi +2051 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +9 -0
- data/sorbet/rbi/gems/listen@3.9.0.rbi +1206 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
- data/sorbet/rbi/gems/lumberjack@1.2.10.rbi +1830 -0
- data/sorbet/rbi/gems/method_source@1.1.0.rbi +9 -0
- data/sorbet/rbi/gems/mime-types-data@3.2025.0617.rbi +136 -0
- data/sorbet/rbi/gems/mime-types@3.7.0.rbi +1342 -0
- data/sorbet/rbi/gems/minitest-rg@5.3.0.rbi +160 -0
- data/sorbet/rbi/gems/minitest@5.25.5.rbi +1640 -0
- data/sorbet/rbi/gems/mocha@2.7.1.rbi +12 -0
- data/sorbet/rbi/gems/multipart-post@2.4.1.rbi +244 -0
- data/sorbet/rbi/gems/nenv@0.3.0.rbi +147 -0
- data/sorbet/rbi/gems/net-http@0.6.0.rbi +4247 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/notiffany@0.1.3.rbi +1079 -0
- data/sorbet/rbi/gems/open_router@0.3.3.rbi +230 -0
- data/sorbet/rbi/gems/ostruct@0.6.2.rbi +354 -0
- data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
- data/sorbet/rbi/gems/parser@3.3.8.0.rbi +5535 -0
- data/sorbet/rbi/gems/prism@1.4.0.rbi +41732 -0
- data/sorbet/rbi/gems/pry@0.15.2.rbi +9 -0
- data/sorbet/rbi/gems/public_suffix@6.0.2.rbi +936 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +158 -0
- data/sorbet/rbi/gems/rack@2.2.17.rbi +5659 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +9 -0
- data/sorbet/rbi/gems/raix@1.0.2.rbi +1104 -0
- data/sorbet/rbi/gems/rake@13.3.0.rbi +3036 -0
- data/sorbet/rbi/gems/rb-fsevent@0.11.2.rbi +9 -0
- data/sorbet/rbi/gems/rb-inotify@0.11.1.rbi +9 -0
- data/sorbet/rbi/gems/rbi@0.3.6.rbi +6893 -0
- data/sorbet/rbi/gems/rbs@3.9.4.rbi +6978 -0
- data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +9 -0
- data/sorbet/rbi/gems/rexml@3.4.1.rbi +5346 -0
- data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-shopify@2.17.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop@1.77.0.rbi +9 -0
- data/sorbet/rbi/gems/ruby-graphviz@1.2.5.rbi +1333 -0
- data/sorbet/rbi/gems/ruby-openai@8.1.0.rbi +758 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +9 -0
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
- data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
- data/sorbet/rbi/gems/shellany@0.0.1.rbi +102 -0
- data/sorbet/rbi/gems/spoom@1.6.3.rbi +6985 -0
- data/sorbet/rbi/gems/sqlite3@2.7.0.rbi +1900 -0
- data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3628 -0
- data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
- data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +9 -0
- data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +9 -0
- data/sorbet/rbi/gems/uri@1.0.3.rbi +2349 -0
- data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
- data/sorbet/rbi/gems/webmock@3.25.1.rbi +1792 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18492 -0
- data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1429 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +36 -0
- metadata +116 -5
- data/lib/roast/workflow/configuration_parser.rb +0 -54
@@ -0,0 +1,672 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `dry-configurable` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem dry-configurable`.
|
6
|
+
|
7
|
+
|
8
|
+
# source://dry-configurable//lib/dry/configurable/constants.rb#3
|
9
|
+
module Dry
|
10
|
+
class << self
|
11
|
+
# @api public
|
12
|
+
#
|
13
|
+
# source://dry-configurable//lib/dry/configurable.rb#11
|
14
|
+
def Configurable(**options); end
|
15
|
+
|
16
|
+
# source://dry-core/1.1.0/lib/dry/core.rb#52
|
17
|
+
def Equalizer(*keys, **options); end
|
18
|
+
|
19
|
+
# source://dry-types/1.8.3/lib/dry/types.rb#253
|
20
|
+
def Types(*namespaces, default: T.unsafe(nil), **aliases); end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# A simple configuration mixin
|
25
|
+
#
|
26
|
+
# @api public
|
27
|
+
# @example class-level configuration
|
28
|
+
#
|
29
|
+
# class App
|
30
|
+
# extend Dry::Configurable
|
31
|
+
#
|
32
|
+
# setting :database do
|
33
|
+
# setting :dsn, 'sqlite:memory'
|
34
|
+
# end
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# App.config.database.dsn = 'jdbc:sqlite:memory'
|
38
|
+
# App.config.database.dsn
|
39
|
+
# # => "jdbc:sqlite:memory"
|
40
|
+
# @example instance-level configuration
|
41
|
+
#
|
42
|
+
# class App
|
43
|
+
# include Dry::Configurable
|
44
|
+
#
|
45
|
+
# setting :database
|
46
|
+
# end
|
47
|
+
#
|
48
|
+
# production = App.new
|
49
|
+
# production.config.database = ENV['DATABASE_URL']
|
50
|
+
# production.finalize!
|
51
|
+
#
|
52
|
+
# development = App.new
|
53
|
+
# development.config.database = 'jdbc:sqlite:memory'
|
54
|
+
# development.finalize!
|
55
|
+
#
|
56
|
+
# source://dry-configurable//lib/dry/configurable/constants.rb#7
|
57
|
+
module Dry::Configurable
|
58
|
+
include ::Dry::Core::Constants
|
59
|
+
extend ::Dry::Core::Deprecations::Interface
|
60
|
+
include ::Dry::Configurable::InstanceMethods
|
61
|
+
|
62
|
+
mixes_in_class_methods ::Dry::Configurable::ClassMethods
|
63
|
+
|
64
|
+
# Mixes in test interface into the configurable module
|
65
|
+
#
|
66
|
+
# @api public
|
67
|
+
#
|
68
|
+
# source://dry-configurable//lib/dry/configurable/test_interface.rb#20
|
69
|
+
def enable_test_interface; end
|
70
|
+
|
71
|
+
class << self
|
72
|
+
# @api private
|
73
|
+
# @private
|
74
|
+
#
|
75
|
+
# source://dry-configurable//lib/dry/configurable.rb#64
|
76
|
+
def extended(klass); end
|
77
|
+
|
78
|
+
# @api private
|
79
|
+
# @private
|
80
|
+
#
|
81
|
+
# source://dry-configurable//lib/dry/configurable.rb#70
|
82
|
+
def included(klass); end
|
83
|
+
|
84
|
+
# @api public
|
85
|
+
#
|
86
|
+
# source://dry-configurable//lib/dry/configurable.rb#49
|
87
|
+
def loader; end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# @api public
|
92
|
+
#
|
93
|
+
# source://dry-configurable//lib/dry/configurable/errors.rb#14
|
94
|
+
class Dry::Configurable::AlreadyIncludedError < ::Dry::Configurable::Error; end
|
95
|
+
|
96
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#7
|
97
|
+
module Dry::Configurable::ClassMethods
|
98
|
+
include ::Dry::Configurable::Methods
|
99
|
+
|
100
|
+
# @api private
|
101
|
+
#
|
102
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#72
|
103
|
+
def __config_build__(settings = T.unsafe(nil)); end
|
104
|
+
|
105
|
+
# @api private
|
106
|
+
#
|
107
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#82
|
108
|
+
def __config_dsl__; end
|
109
|
+
|
110
|
+
# @api private
|
111
|
+
#
|
112
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#77
|
113
|
+
def __config_extension__; end
|
114
|
+
|
115
|
+
# @api private
|
116
|
+
#
|
117
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#90
|
118
|
+
def __config_reader__; end
|
119
|
+
|
120
|
+
# Return configuration
|
121
|
+
#
|
122
|
+
# @api public
|
123
|
+
# @return [Config]
|
124
|
+
#
|
125
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#67
|
126
|
+
def config; end
|
127
|
+
|
128
|
+
# @api private
|
129
|
+
#
|
130
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#11
|
131
|
+
def inherited(subclass); end
|
132
|
+
|
133
|
+
# Add a setting to the configuration
|
134
|
+
#
|
135
|
+
# @api public
|
136
|
+
# @param name [Mixed] The accessor key for the configuration value
|
137
|
+
# @param default [Mixed] Default value for the setting
|
138
|
+
# @param constructor [#call] Transformation given value will go through
|
139
|
+
# @param reader [Boolean] Whether a reader accessor must be created
|
140
|
+
# @return [Dry::Configurable::Config]
|
141
|
+
# @yield A block can be given to add nested settings.
|
142
|
+
#
|
143
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#43
|
144
|
+
def setting(*_arg0, **_arg1, &_arg2); end
|
145
|
+
|
146
|
+
# Returns the defined settings for the class.
|
147
|
+
#
|
148
|
+
# @api public
|
149
|
+
# @return [Settings]
|
150
|
+
#
|
151
|
+
# source://dry-configurable//lib/dry/configurable/class_methods.rb#58
|
152
|
+
def settings; end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Setting compiler used internally by the DSL
|
156
|
+
#
|
157
|
+
# @api private
|
158
|
+
#
|
159
|
+
# source://dry-configurable//lib/dry/configurable/compiler.rb#8
|
160
|
+
class Dry::Configurable::Compiler
|
161
|
+
# @api private
|
162
|
+
#
|
163
|
+
# source://dry-configurable//lib/dry/configurable/compiler.rb#9
|
164
|
+
def call(ast); end
|
165
|
+
|
166
|
+
# @api private
|
167
|
+
#
|
168
|
+
# source://dry-configurable//lib/dry/configurable/compiler.rb#18
|
169
|
+
def visit(node); end
|
170
|
+
|
171
|
+
# @api private
|
172
|
+
#
|
173
|
+
# source://dry-configurable//lib/dry/configurable/compiler.rb#30
|
174
|
+
def visit_nested(node); end
|
175
|
+
|
176
|
+
# @api private
|
177
|
+
#
|
178
|
+
# source://dry-configurable//lib/dry/configurable/compiler.rb#24
|
179
|
+
def visit_setting(node); end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Config exposes setting values through a convenient API
|
183
|
+
#
|
184
|
+
# @api public
|
185
|
+
#
|
186
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#10
|
187
|
+
class Dry::Configurable::Config
|
188
|
+
include ::Dry::Core::Equalizer::Methods
|
189
|
+
|
190
|
+
# @api private
|
191
|
+
# @return [Config] a new instance of Config
|
192
|
+
#
|
193
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#24
|
194
|
+
def initialize(settings, values: T.unsafe(nil)); end
|
195
|
+
|
196
|
+
# Get config value by a key
|
197
|
+
#
|
198
|
+
# @api public
|
199
|
+
# @param name [String, Symbol]
|
200
|
+
# @return Config value
|
201
|
+
#
|
202
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#47
|
203
|
+
def [](name); end
|
204
|
+
|
205
|
+
# Set config value.
|
206
|
+
# Note that finalized configs cannot be changed.
|
207
|
+
#
|
208
|
+
# @api public
|
209
|
+
# @param name [String, Symbol]
|
210
|
+
# @param value [Object]
|
211
|
+
# @raise [FrozenConfigError]
|
212
|
+
#
|
213
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#69
|
214
|
+
def []=(name, value); end
|
215
|
+
|
216
|
+
# @api private
|
217
|
+
#
|
218
|
+
# source://dry-core/1.1.0/lib/dry/core/equalizer.rb#87
|
219
|
+
def _dry_equalizer_hash; end
|
220
|
+
|
221
|
+
# @api private
|
222
|
+
#
|
223
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#14
|
224
|
+
def _settings; end
|
225
|
+
|
226
|
+
# @api private
|
227
|
+
#
|
228
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#17
|
229
|
+
def _values; end
|
230
|
+
|
231
|
+
# Returns true if the value for the given key has been set on this config.
|
232
|
+
#
|
233
|
+
# For simple values, this returns true if the value has been explicitly assigned.
|
234
|
+
#
|
235
|
+
# For cloneable (mutable) values, since these are captured on read, returns true if the value
|
236
|
+
# does not compare equally to its corresdponing default value. This relies on these objects
|
237
|
+
# having functioning `#==` checks.
|
238
|
+
#
|
239
|
+
# @api public
|
240
|
+
# @return [Bool]
|
241
|
+
#
|
242
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#116
|
243
|
+
def configured?(key); end
|
244
|
+
|
245
|
+
# @api private
|
246
|
+
#
|
247
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#38
|
248
|
+
def dup_for_settings(settings); end
|
249
|
+
|
250
|
+
# @api public
|
251
|
+
#
|
252
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#159
|
253
|
+
def finalize!(freeze_values: T.unsafe(nil)); end
|
254
|
+
|
255
|
+
# @api public
|
256
|
+
#
|
257
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#152
|
258
|
+
def hash; end
|
259
|
+
|
260
|
+
# @api private
|
261
|
+
#
|
262
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#181
|
263
|
+
def pristine; end
|
264
|
+
|
265
|
+
# Returns config values as a hash, with nested values also converted from {Config} instances
|
266
|
+
# into hashes.
|
267
|
+
#
|
268
|
+
# @api public
|
269
|
+
# @return [Hash]
|
270
|
+
#
|
271
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#144
|
272
|
+
def to_h; end
|
273
|
+
|
274
|
+
# Update config with new values
|
275
|
+
#
|
276
|
+
# @api public
|
277
|
+
# @param values [Hash, #to_hash] A hash with new values
|
278
|
+
# @return [Config]
|
279
|
+
#
|
280
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#90
|
281
|
+
def update(values); end
|
282
|
+
|
283
|
+
# Returns the current config values.
|
284
|
+
#
|
285
|
+
# Nested configs remain in their {Config} instances.
|
286
|
+
#
|
287
|
+
# @api public
|
288
|
+
# @return [Hash]
|
289
|
+
#
|
290
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#131
|
291
|
+
def values; end
|
292
|
+
|
293
|
+
protected
|
294
|
+
|
295
|
+
# @api private
|
296
|
+
#
|
297
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#20
|
298
|
+
def _configured; end
|
299
|
+
|
300
|
+
private
|
301
|
+
|
302
|
+
# @api public
|
303
|
+
#
|
304
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#208
|
305
|
+
def dup_values; end
|
306
|
+
|
307
|
+
# @api private
|
308
|
+
# @api public
|
309
|
+
#
|
310
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#31
|
311
|
+
def initialize_copy(source); end
|
312
|
+
|
313
|
+
# @api public
|
314
|
+
#
|
315
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#187
|
316
|
+
def method_missing(name, *args); end
|
317
|
+
|
318
|
+
# @api public
|
319
|
+
# @return [Boolean]
|
320
|
+
#
|
321
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#200
|
322
|
+
def respond_to_missing?(meth, include_private = T.unsafe(nil)); end
|
323
|
+
|
324
|
+
# @api public
|
325
|
+
#
|
326
|
+
# source://dry-configurable//lib/dry/configurable/config.rb#204
|
327
|
+
def setting_name_from_method(method_name); end
|
328
|
+
end
|
329
|
+
|
330
|
+
# Setting DSL used by the class API
|
331
|
+
#
|
332
|
+
# @api private
|
333
|
+
#
|
334
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#8
|
335
|
+
class Dry::Configurable::DSL
|
336
|
+
# @api private
|
337
|
+
# @return [DSL] a new instance of DSL
|
338
|
+
#
|
339
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#17
|
340
|
+
def initialize(**options, &block); end
|
341
|
+
|
342
|
+
# @api private
|
343
|
+
#
|
344
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#13
|
345
|
+
def ast; end
|
346
|
+
|
347
|
+
# @api private
|
348
|
+
#
|
349
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#11
|
350
|
+
def compiler; end
|
351
|
+
|
352
|
+
# @api private
|
353
|
+
#
|
354
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#49
|
355
|
+
def config_class; end
|
356
|
+
|
357
|
+
# @api private
|
358
|
+
#
|
359
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#53
|
360
|
+
def default; end
|
361
|
+
|
362
|
+
# @api private
|
363
|
+
#
|
364
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#15
|
365
|
+
def options; end
|
366
|
+
|
367
|
+
# Registers a new setting node and compile it into a setting object
|
368
|
+
#
|
369
|
+
# @api private
|
370
|
+
# @return Setting
|
371
|
+
# @see ClassMethods.setting
|
372
|
+
#
|
373
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#29
|
374
|
+
def setting(name, **options, &block); end
|
375
|
+
|
376
|
+
private
|
377
|
+
|
378
|
+
# @api private
|
379
|
+
# @raise [ArgumentError]
|
380
|
+
#
|
381
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#59
|
382
|
+
def ensure_valid_options(options); end
|
383
|
+
|
384
|
+
# Returns a tuple of valid and invalid options hashes derived from the options hash
|
385
|
+
# given to the setting
|
386
|
+
#
|
387
|
+
# @api private
|
388
|
+
#
|
389
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#69
|
390
|
+
def valid_and_invalid_options(options); end
|
391
|
+
end
|
392
|
+
|
393
|
+
# @api private
|
394
|
+
#
|
395
|
+
# source://dry-configurable//lib/dry/configurable/dsl.rb#9
|
396
|
+
Dry::Configurable::DSL::VALID_NAME = T.let(T.unsafe(nil), Regexp)
|
397
|
+
|
398
|
+
# @api public
|
399
|
+
#
|
400
|
+
# source://dry-configurable//lib/dry/configurable/errors.rb#10
|
401
|
+
class Dry::Configurable::Error < ::StandardError; end
|
402
|
+
|
403
|
+
# @api public
|
404
|
+
#
|
405
|
+
# source://dry-configurable//lib/dry/configurable/extension.rb#5
|
406
|
+
class Dry::Configurable::Extension < ::Module
|
407
|
+
# @api private
|
408
|
+
# @return [Extension] a new instance of Extension
|
409
|
+
#
|
410
|
+
# source://dry-configurable//lib/dry/configurable/extension.rb#13
|
411
|
+
def initialize(config_class: T.unsafe(nil), default_undefined: T.unsafe(nil)); end
|
412
|
+
|
413
|
+
# @api private
|
414
|
+
#
|
415
|
+
# source://dry-configurable//lib/dry/configurable/extension.rb#7
|
416
|
+
def config_class; end
|
417
|
+
|
418
|
+
# @api private
|
419
|
+
#
|
420
|
+
# source://dry-configurable//lib/dry/configurable/extension.rb#10
|
421
|
+
def default_undefined; end
|
422
|
+
|
423
|
+
# @api private
|
424
|
+
#
|
425
|
+
# source://dry-configurable//lib/dry/configurable/extension.rb#21
|
426
|
+
def extended(klass); end
|
427
|
+
|
428
|
+
# @api private
|
429
|
+
#
|
430
|
+
# source://dry-configurable//lib/dry/configurable/extension.rb#28
|
431
|
+
def included(klass); end
|
432
|
+
end
|
433
|
+
|
434
|
+
# @api public
|
435
|
+
#
|
436
|
+
# source://dry-configurable//lib/dry/configurable/errors.rb#12
|
437
|
+
class Dry::Configurable::FrozenConfigError < ::Dry::Configurable::Error; end
|
438
|
+
|
439
|
+
# Initializer method which is prepended when `Dry::Configurable`
|
440
|
+
# is included in a class
|
441
|
+
#
|
442
|
+
# @api private
|
443
|
+
#
|
444
|
+
# source://dry-configurable//lib/dry/configurable/instance_methods.rb#12
|
445
|
+
module Dry::Configurable::Initializer
|
446
|
+
# @api private
|
447
|
+
#
|
448
|
+
# source://dry-configurable//lib/dry/configurable/instance_methods.rb#14
|
449
|
+
def initialize(*_arg0, **_arg1); end
|
450
|
+
end
|
451
|
+
|
452
|
+
# Instance-level API when `Dry::Configurable` is included in a class
|
453
|
+
#
|
454
|
+
# @api public
|
455
|
+
#
|
456
|
+
# source://dry-configurable//lib/dry/configurable/instance_methods.rb#25
|
457
|
+
module Dry::Configurable::InstanceMethods
|
458
|
+
include ::Dry::Configurable::Methods
|
459
|
+
|
460
|
+
# Return object's configuration
|
461
|
+
#
|
462
|
+
# @api public
|
463
|
+
# @return [Config]
|
464
|
+
#
|
465
|
+
# source://dry-configurable//lib/dry/configurable/instance_methods.rb#33
|
466
|
+
def config; end
|
467
|
+
|
468
|
+
# Finalize the config and freeze the object
|
469
|
+
#
|
470
|
+
# @api public
|
471
|
+
#
|
472
|
+
# source://dry-configurable//lib/dry/configurable/instance_methods.rb#40
|
473
|
+
def finalize!(freeze_values: T.unsafe(nil)); end
|
474
|
+
|
475
|
+
private
|
476
|
+
|
477
|
+
# @api public
|
478
|
+
#
|
479
|
+
# source://dry-configurable//lib/dry/configurable/instance_methods.rb#48
|
480
|
+
def initialize_copy(source); end
|
481
|
+
end
|
482
|
+
|
483
|
+
# Common API for both classes and instances
|
484
|
+
#
|
485
|
+
# @api public
|
486
|
+
#
|
487
|
+
# source://dry-configurable//lib/dry/configurable/methods.rb#8
|
488
|
+
module Dry::Configurable::Methods
|
489
|
+
# @api public
|
490
|
+
# @raise [FrozenConfigError]
|
491
|
+
# @yield [config]
|
492
|
+
#
|
493
|
+
# source://dry-configurable//lib/dry/configurable/methods.rb#10
|
494
|
+
def configure(&block); end
|
495
|
+
|
496
|
+
# Finalize and freeze configuration
|
497
|
+
#
|
498
|
+
# @api public
|
499
|
+
# @return [Dry::Configurable::Config]
|
500
|
+
#
|
501
|
+
# source://dry-configurable//lib/dry/configurable/methods.rb#22
|
502
|
+
def finalize!(freeze_values: T.unsafe(nil)); end
|
503
|
+
end
|
504
|
+
|
505
|
+
# A defined setting.
|
506
|
+
#
|
507
|
+
# @api public
|
508
|
+
#
|
509
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#10
|
510
|
+
class Dry::Configurable::Setting
|
511
|
+
include ::Dry::Core::Equalizer::Methods
|
512
|
+
|
513
|
+
# @api private
|
514
|
+
# @return [Setting] a new instance of Setting
|
515
|
+
#
|
516
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#43
|
517
|
+
def initialize(name, default:, constructor: T.unsafe(nil), children: T.unsafe(nil), **options); end
|
518
|
+
|
519
|
+
# @api public
|
520
|
+
#
|
521
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#32
|
522
|
+
def children; end
|
523
|
+
|
524
|
+
# @api public
|
525
|
+
# @return [Boolean]
|
526
|
+
#
|
527
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#67
|
528
|
+
def cloneable?; end
|
529
|
+
|
530
|
+
# @api public
|
531
|
+
#
|
532
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#29
|
533
|
+
def constructor; end
|
534
|
+
|
535
|
+
# @api public
|
536
|
+
#
|
537
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#23
|
538
|
+
def default; end
|
539
|
+
|
540
|
+
# @api public
|
541
|
+
#
|
542
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#26
|
543
|
+
def mutable; end
|
544
|
+
|
545
|
+
# @api public
|
546
|
+
# @return [Boolean]
|
547
|
+
#
|
548
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#67
|
549
|
+
def mutable?; end
|
550
|
+
|
551
|
+
# @api public
|
552
|
+
#
|
553
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#20
|
554
|
+
def name; end
|
555
|
+
|
556
|
+
# @api public
|
557
|
+
#
|
558
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#35
|
559
|
+
def options; end
|
560
|
+
|
561
|
+
# @api private
|
562
|
+
# @return [Boolean]
|
563
|
+
#
|
564
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#62
|
565
|
+
def reader?; end
|
566
|
+
|
567
|
+
# @api private
|
568
|
+
#
|
569
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#73
|
570
|
+
def to_value; end
|
571
|
+
|
572
|
+
class << self
|
573
|
+
# @api private
|
574
|
+
# @return [Boolean]
|
575
|
+
#
|
576
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#38
|
577
|
+
def mutable_value?(value); end
|
578
|
+
end
|
579
|
+
end
|
580
|
+
|
581
|
+
# @api public
|
582
|
+
#
|
583
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#15
|
584
|
+
Dry::Configurable::Setting::DEFAULT_CONSTRUCTOR = T.let(T.unsafe(nil), Proc)
|
585
|
+
|
586
|
+
# @api public
|
587
|
+
#
|
588
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#17
|
589
|
+
Dry::Configurable::Setting::MUTABLE_VALUE_TYPES = T.let(T.unsafe(nil), Array)
|
590
|
+
|
591
|
+
# @api public
|
592
|
+
#
|
593
|
+
# source://dry-configurable//lib/dry/configurable/setting.rb#13
|
594
|
+
Dry::Configurable::Setting::OPTIONS = T.let(T.unsafe(nil), Array)
|
595
|
+
|
596
|
+
# A collection of defined settings on a given class.
|
597
|
+
#
|
598
|
+
# @api private
|
599
|
+
#
|
600
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#8
|
601
|
+
class Dry::Configurable::Settings
|
602
|
+
include ::Dry::Core::Equalizer::Methods
|
603
|
+
include ::Enumerable
|
604
|
+
|
605
|
+
# @api private
|
606
|
+
# @return [Settings] a new instance of Settings
|
607
|
+
#
|
608
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#17
|
609
|
+
def initialize(settings = T.unsafe(nil)); end
|
610
|
+
|
611
|
+
# @api private
|
612
|
+
#
|
613
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#27
|
614
|
+
def <<(setting); end
|
615
|
+
|
616
|
+
# Returns the setting for the given name, if found.
|
617
|
+
#
|
618
|
+
# @api public
|
619
|
+
# @return [Setting, nil] the setting, or nil if not found
|
620
|
+
#
|
621
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#37
|
622
|
+
def [](name); end
|
623
|
+
|
624
|
+
# @api public
|
625
|
+
#
|
626
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#60
|
627
|
+
def each(&_arg0); end
|
628
|
+
|
629
|
+
# Returns true if a setting for the given name is defined.
|
630
|
+
#
|
631
|
+
# @api public
|
632
|
+
# @return [Boolean]
|
633
|
+
#
|
634
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#46
|
635
|
+
def key?(name); end
|
636
|
+
|
637
|
+
# Returns the list of defined setting names.
|
638
|
+
#
|
639
|
+
# @api public
|
640
|
+
# @return [Array<Symbol>]
|
641
|
+
#
|
642
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#55
|
643
|
+
def keys; end
|
644
|
+
|
645
|
+
# @api private
|
646
|
+
#
|
647
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#14
|
648
|
+
def settings; end
|
649
|
+
|
650
|
+
private
|
651
|
+
|
652
|
+
# @api private
|
653
|
+
# @api private
|
654
|
+
#
|
655
|
+
# source://dry-configurable//lib/dry/configurable/settings.rb#22
|
656
|
+
def initialize_copy(source); end
|
657
|
+
end
|
658
|
+
|
659
|
+
# Methods meant to be used in a testing scenario
|
660
|
+
#
|
661
|
+
# @api public
|
662
|
+
#
|
663
|
+
# source://dry-configurable//lib/dry/configurable/test_interface.rb#6
|
664
|
+
module Dry::Configurable::TestInterface
|
665
|
+
# Resets configuration to default values
|
666
|
+
#
|
667
|
+
# @api public
|
668
|
+
# @return [Dry::Configurable::Config]
|
669
|
+
#
|
670
|
+
# source://dry-configurable//lib/dry/configurable/test_interface.rb#12
|
671
|
+
def reset_config; end
|
672
|
+
end
|