lib/docparser/output/screen_output.rb in docparser-0.0.1 vs lib/docparser/output/screen_output.rb in docparser-0.1.0
- old
+ new
@@ -1,9 +1,9 @@
require 'terminal-table'
require 'pageme'
module DocParser
- # This Output is can be used for debugging purposes.
+ # This Output can be used for debugging purposes.
# It pipes all rows through a pager
# @see Output
class ScreenOutput < Output
# @!visibility private
@@ -23,9 +23,10 @@
end
end
end
def write_row(row)
+ raise MissingHeaderException if @header.nil? || @header.length == 0
out = []
0.upto(@header.length - 1) do |counter|
out << [@header[counter], row[counter]]
end
@tables << Terminal::Table.new(rows: out)
\ No newline at end of file