# File lib/cucumber/core/gherkin/writer/helpers.rb, line 137 def row(*cells) rows << cells end
# File lib/cucumber/core/gherkin/writer/helpers.rb, line 141 def rows @rows ||= [] end
# File lib/cucumber/core/gherkin/writer/helpers.rb, line 160 def column_length(column) lengths = rows.transpose.map { |r| r.map(&:length).max } lengths[column] end
# File lib/cucumber/core/gherkin/writer/helpers.rb, line 165 def justify_cell(cell, position) cell.ljust(column_length(position)) end
# File lib/cucumber/core/gherkin/writer/helpers.rb, line 156 def pad(row) row.map.with_index { |text, position| justify_cell(text, position) } end
# File lib/cucumber/core/gherkin/writer/helpers.rb, line 147 def row_statements(indent=nil) rows.map { |row| indent(table_row(row), indent) } end
# File lib/cucumber/core/gherkin/writer/helpers.rb, line 151 def table_row(row) padded = pad(row) "| #{padded.join(' | ')} |" end