Class: Text::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/github_issue_stats.rb

Overview

Extend Text::Table with markdown support. Taken from github.com/aptinio/text-table/pull/10

Instance Method Summary collapse

Instance Method Details

#to_markdownObject



11
12
13
14
15
16
17
18
# File 'lib/github_issue_stats.rb', line 11

def to_markdown
  b = @boundary_intersection
  @boundary_intersection = '|'
  rendered_rows = [separator] + text_table_rows.map(&:to_s)
  rendered_rows.unshift [text_table_head.to_s] if head
  @boundary_intersection = b
  rendered_rows.join.gsub('|--', '| :').gsub('--|', ': |')
end