Class: Foxtail::CLI::Commands::Dump
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Foxtail::CLI::Commands::Dump
- Defined in:
- lib/foxtail/cli/commands/dump.rb
Overview
Dump FTL files as AST in JSON format
Instance Method Summary collapse
-
#call(files:, with_spans:) ⇒ void
Execute the dump command.
Instance Method Details
#call(files:, with_spans:) ⇒ void
This method returns an undefined value.
Execute the dump command
21 22 23 24 25 26 27 28 |
# File 'lib/foxtail/cli/commands/dump.rb', line 21 def call(files:, with_spans:, **) raise Foxtail::CLI::NoFilesError if files.empty? results = files.map {|file| dump_file(Pathname(file), with_spans:) } output = files.size == 1 ? results.first : results out.puts JSON.pretty_generate(output) end |