Class: BundleOutdatedFormatter::CSVFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/bundle_outdated_formatter/formatter/csv_formatter.rb

Overview

Formatter for CSV

Constant Summary

Constants inherited from Formatter

Formatter::COLUMNS, Formatter::GEM_REGEXP, Formatter::GROUPS_REGEXP, Formatter::INSTALLED_REGEXP, Formatter::NEWEST_REGEXP, Formatter::REQUESTED_REGEXP

Instance Method Summary collapse

Methods inherited from Formatter

#initialize, #read_stdin

Constructor Details

This class inherits a constructor from BundleOutdatedFormatter::Formatter

Instance Method Details

#convertObject



7
8
9
10
11
12
13
14
15
# File 'lib/bundle_outdated_formatter/formatter/csv_formatter.rb', line 7

def convert
  text = CSV.generate(force_quotes: true) do |csv|
    csv << COLUMNS
    @outdated_gems.each do |gem|
      csv << gem.values
    end
  end
  text.chomp
end