Class: XDep::CSVOutput
Direct Known Subclasses
Constant Summary collapse
- HEADER =
%w[Language Name Version Description Homepage License].freeze
Instance Method Summary collapse
Methods inherited from Output
Constructor Details
This class inherits a constructor from XDep::Output
Instance Method Details
#process(input, output) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/xdep/output.rb', line 27 def process(input, output) rows = get_rows(input) rows.sort_by! { |r| r[1] } mode = output.pos.zero? ? "w" : "a" CSV.open(output, mode) do |csv| csv << HEADER if output.pos.zero? rows.each { |r| csv << r } end end |