Class: XRT::Command::Dump

Inherits:
Object
  • Object
show all
Defined in:
lib/xrt/command/dump.rb

Instance Method Summary collapse

Instance Method Details

#annotate_file(target_file, enable_color = nil) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/xrt/command/dump.rb', line 12

def annotate_file target_file, enable_color=nil
  checker = XRT::DepthChecker.new
  parsed, annotated_source = checker.check open(target_file).read, enable_color
  unless parsed
    raise "Failed to parse #{target_file}"
  end
  annotated_source
end

#execute(files) ⇒ Object



6
7
8
9
10
# File 'lib/xrt/command/dump.rb', line 6

def execute(files)
  files.each{|file|
    puts annotate_file file, STDOUT.tty?
  }
end