Class: Command::Trace

Inherits:
CommandBase show all
Defined in:
lib/command/trace.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommandBase

#execute!, execute!, #force_change_settings_function, help, #hook_call, #load_local_settings, #tagname_to_ids

Constructor Details

#initializeTrace

Returns a new instance of Trace.



13
14
15
16
17
18
19
20
# File 'lib/command/trace.rb', line 13

def initialize
  super(" ")
  @opt.separator <<-MSG

  ・エラーが発生した際に保存されたバックトレースログを表示します。
  ・ログテキスト自体は #{Narou::Backtracer.log_path} に保存されています。
  MSG
end

Class Method Details

.oneline_helpObject



9
10
11
# File 'lib/command/trace.rb', line 9

def self.oneline_help
  "エラーログを表示します"
end

Instance Method Details

#execute(argv) ⇒ Object



22
23
24
25
26
# File 'lib/command/trace.rb', line 22

def execute(argv)
  super
  return unless File.exist?(Narou::Backtracer.log_path)
  puts File.read(Narou::Backtracer.log_path)
end