Class: Suma::Cli::Core
- Inherits:
-
Thor
- Object
- Thor
- Suma::Cli::Core
- Extended by:
- ThorExt::Start
- Defined in:
- lib/suma/cli/core.rb
Overview
Top-level CLI entrypoint.
Each command delegates to a dedicated Thor class under Suma::Cli::,
which reparses ARGV and therefore owns the canonical option
declarations. Re-declaring options here would duplicate the inner
classes' declarations and cause help text and validation logic to
drift. Options are declared in exactly one place (the inner class).
The exception is check_svg_quality, which constructs its analyzer
inline (no inner Thor class), so its options belong here.
Class Method Summary collapse
Instance Method Summary collapse
- #build(_site_manifest) ⇒ Object
- #check_svg_quality(path = Cli::CheckSvgQuality::DATA_PATH) ⇒ Object
- #compare(_trial_schema, _reference_schema) ⇒ Object
- #convert_jsdai(_xml_file, _image_file, _output_dir) ⇒ Object
- #export(*_files) ⇒ Object
- #extract_terms(schema_manifest_file, glossarist_output_path) ⇒ Object
- #generate_register(schema_manifest_file, output_path) ⇒ Object
- #generate_schemas(_metanorma_manifest_file, _schema_manifest_file) ⇒ Object
- #reformat(_express_file_path) ⇒ Object
Methods included from ThorExt::Start
Class Method Details
.exit_on_failure? ⇒ Boolean
142 143 144 |
# File 'lib/suma/cli/core.rb', line 142 def self.exit_on_failure? true end |
Instance Method Details
#build(_site_manifest) ⇒ Object
24 25 26 |
# File 'lib/suma/cli/core.rb', line 24 def build(_site_manifest) Cli::Build.start end |
#check_svg_quality(path = Cli::CheckSvgQuality::DATA_PATH) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/suma/cli/core.rb', line 124 def check_svg_quality(path = Cli::CheckSvgQuality::DATA_PATH) analyzer = Cli::CheckSvgQuality.new( pattern: [:pattern], profile: [:profile], format: [:format], output: [:output], min_errors: [:min_errors], summary_only: [:summary_only], progress: [:progress], limit: [:limit], sort: [:sort], ) analyzer.run(path) end |
#compare(_trial_schema, _reference_schema) ⇒ Object
96 97 98 |
# File 'lib/suma/cli/core.rb', line 96 def compare(_trial_schema, _reference_schema) Cli::Compare.start end |
#convert_jsdai(_xml_file, _image_file, _output_dir) ⇒ Object
83 84 85 |
# File 'lib/suma/cli/core.rb', line 83 def convert_jsdai(_xml_file, _image_file, _output_dir) Cli::ConvertJsdai.start end |
#export(*_files) ⇒ Object
90 91 92 |
# File 'lib/suma/cli/core.rb', line 90 def export(*_files) Cli::Export.start end |
#extract_terms(schema_manifest_file, glossarist_output_path) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/suma/cli/core.rb', line 48 def extract_terms(schema_manifest_file, glossarist_output_path) TermExtractor.new( schema_manifest_file, glossarist_output_path, urn: [:urn], language_code: [:language_code], ).call end |
#generate_register(schema_manifest_file, output_path) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/suma/cli/core.rb', line 69 def generate_register(schema_manifest_file, output_path) RegisterManifestGenerator.new( schema_manifest_file, output_path, urn: [:urn], id: [:id], ref: [:ref], language_code: [:language_code], owner: [:owner], ).generate end |
#generate_schemas(_metanorma_manifest_file, _schema_manifest_file) ⇒ Object
30 31 32 |
# File 'lib/suma/cli/core.rb', line 30 def generate_schemas(, _schema_manifest_file) Cli::GenerateSchemas.start end |