Class: LicenseFinder::CsvReport
- Inherits:
-
Report
- Object
- Report
- LicenseFinder::CsvReport
show all
- Defined in:
- lib/license_finder/reports/csv_report.rb
Constant Summary
collapse
- COMMA_SEP =
','.freeze
- AVAILABLE_COLUMNS =
%w[name version authors licenses license_links approved summary description homepage install_path package_manager groups texts notice].freeze
- MISSING_DEPENDENCY_TEXT =
'This package is not installed. Please install to determine licenses.'.freeze
Instance Method Summary
collapse
Methods inherited from Report
of
Constructor Details
#initialize(dependencies, options) ⇒ CsvReport
9
10
11
12
13
|
# File 'lib/license_finder/reports/csv_report.rb', line 9
def initialize(dependencies, options)
super
options[:columns] ||= %w[name version licenses]
@columns = Array(options[:columns]) & self.class::AVAILABLE_COLUMNS
end
|
Instance Method Details
#to_s ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/license_finder/reports/csv_report.rb', line 15
def to_s
CSV.generate(col_sep: self.class::COMMA_SEP) do |csv|
sorted_dependencies.each do |s|
csv << format_dependency(s)
end
end
end
|