class BundleOutdatedFormatter::MarkdownFormatter

Formatter for Markdown

Public Instance Methods

convert() click to toggle source
# File lib/bundle_outdated_formatter/formatter/markdown_formatter.rb, line 6
def convert
  @outdated_gems.map! do |gem|
    "| #{gem.values.join(' | ')} |".gsub(/  /, ' ')
  end

  (header + @outdated_gems.join("\n")).chomp
end

Private Instance Methods

header() click to toggle source
# File lib/bundle_outdated_formatter/formatter/markdown_formatter.rb, line 16
    def header
      <<-EOS
| #{@columns.join(' | ')} |
| #{Array.new(@columns.size, '---').join(' | ')} |
      EOS
    end