Class: BundleOutdatedFormatter::HTMLFormatter
- Defined in:
- lib/bundle_outdated_formatter/formatter/html_formatter.rb
Overview
Formatter for HTML
Constant Summary
Constants inherited from Formatter
Formatter::GEM_REGEXP, Formatter::GROUPS_REGEXP, Formatter::INSTALLED_REGEXP, Formatter::NEWEST_REGEXP, Formatter::REQUESTED_REGEXP
Instance Method Summary collapse
- #convert ⇒ Object
-
#initialize(options) ⇒ HTMLFormatter
constructor
A new instance of HTMLFormatter.
Methods inherited from Formatter
Constructor Details
#initialize(options) ⇒ HTMLFormatter
Returns a new instance of HTMLFormatter.
7 8 9 10 11 12 13 |
# File 'lib/bundle_outdated_formatter/formatter/html_formatter.rb', line 7 def initialize() super() @html = REXML::Document.new(nil, raw: :all) @root = REXML::Element.new('table') @html.add_element(@root) end |
Instance Method Details
#convert ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bundle_outdated_formatter/formatter/html_formatter.rb', line 15 def convert add_header_row @outdated_gems.each do |gem| add_data_row(gem) end io = StringIO.new xml_formatter.write(@html, io) io.string.chomp end |