Class: RosettAi::Thor::Tasks::Config
- Inherits:
-
Thor
- Object
- Thor
- RosettAi::Thor::Tasks::Config
- Defined in:
- lib/rosett_ai/thor/tasks/config.rb
Overview
Thor task for compiling engine configuration YAML to settings JSON.
Instance Method Summary collapse
-
#compile ⇒ void
Compile the configuration.
-
#show(scope) ⇒ void
Display detailed information for the named item.
Instance Method Details
#compile ⇒ void
This method returns an undefined value.
Compile the configuration.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/rosett_ai/thor/tasks/config.rb', line 96 def compile compiler = resolve_config_compiler(simulate: [:simulate], strict: [:strict]) results = if [:scope] scope_path = find_scope_file([:scope], compiler) [compiler.compile_scope(scope_path)] else compiler.compile end if results.empty? puts Rainbow(t('no_scopes')).yellow return end results.each { |r| print_result(r) } print_warnings(results) if [:verbose] compiler.write_results(results) unless [:simulate] print_summary(results) abort_if_failed(results) end |
#show(scope) ⇒ void
This method returns an undefined value.
Display detailed information for the named item.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/rosett_ai/thor/tasks/config.rb', line 43 def show(scope) scope = RosettAi::TextSanitizer.normalize_nfc(scope) compiler = resolve_config_compiler(simulate: true, masking: true) scope_path = find_scope_file(scope, compiler) if [:raw] print_raw_source(scope_path) else print_compiled_json(scope_path, compiler) end end |