Class: Chemicalml::Cli::InspectCommand
- Defined in:
- lib/chemicalml/cli/inspect_command.rb
Overview
chemicalml inspect <file> — print a tree-style summary of
the document: element names, ids, nested children.
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
Constructor Details
This class inherits a constructor from Chemicalml::Cli::Command
Instance Method Details
#run(options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/chemicalml/cli/inspect_command.rb', line 8 def run() path = [:file] unless path logger.error 'inspect requires a <file> argument' return 2 end doc = Chemicalml.parse(File.read(path), schema: :schema3) print_tree(doc, 0) 0 rescue ArgumentError, Lutaml::Model::InvalidFormatError => e logger.error "FAIL: #{e.}" 2 end |