Class: Textpow::DebugProcessor
- Inherits:
-
Object
- Object
- Textpow::DebugProcessor
- Defined in:
- lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb,
lib/ultra_pow_list/vendor/ruby1.9/textpow/textpow/debug_processor.rb
Instance Method Summary collapse
- #close_tag(name, position) ⇒ Object
- #end_parsing(name) ⇒ Object
-
#initialize ⇒ DebugProcessor
constructor
A new instance of DebugProcessor.
- #new_line(line) ⇒ Object
- #open_tag(name, position) ⇒ Object
- #pprint(line, string, position = 0) ⇒ Object
- #start_parsing(name) ⇒ Object
Constructor Details
#initialize ⇒ DebugProcessor
Returns a new instance of DebugProcessor.
3 4 5 6 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 3 def initialize @line_number = 0 @printable_line = "" end |
Instance Method Details
#close_tag(name, position) ⇒ Object
18 19 20 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 18 def close_tag name, position STDERR.puts pprint( "", "}#{name}", position + @line_marks.size) end |
#end_parsing(name) ⇒ Object
32 33 34 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 32 def end_parsing name STDERR.puts "}#{name}" end |
#new_line(line) ⇒ Object
22 23 24 25 26 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 22 def new_line line @line_number += 1 @line_marks = "[#{@line_number.to_s.rjust( 4, '0' )}] " STDERR.puts "#{@line_marks}#{line}" end |
#open_tag(name, position) ⇒ Object
14 15 16 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 14 def open_tag name, position STDERR.puts pprint( "", "{#{name}", position + @line_marks.size) end |
#pprint(line, string, position = 0) ⇒ Object
8 9 10 11 12 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 8 def pprint line, string, position = 0 line.replace line.ljust( position + string.size, " ") line[position,string.size] = string line end |
#start_parsing(name) ⇒ Object
28 29 30 |
# File 'lib/ultra_pow_list/vendor/ruby1.8/textpow/textpow/debug_processor.rb', line 28 def start_parsing name STDERR.puts "{#{name}" end |