Class: Legion::CLI::Debug

Inherits:
Thor
  • Object
show all
Defined in:
lib/legion/cli/debug_command.rb

Constant Summary collapse

DEBUG_DIR =
File.expand_path('~/.legionio/debug')

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/legion/cli/debug_command.rb', line 14

def self.exit_on_failure?
  true
end

Instance Method Details

#dumpObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/legion/cli/debug_command.rb', line 26

def dump
  sections = collect_all_sections

  output = if options[:json]
             ::JSON.pretty_generate(sections)
           else
             build_markdown(sections)
           end

  puts output

  path = write_dump_file(output)
  warn "Saved to #{path}" if path
end