Class: Rspeckled::Reporting::Outputs::Csv
- Inherits:
-
Object
- Object
- Rspeckled::Reporting::Outputs::Csv
- Defined in:
- lib/rspeckled/reporting/outputs/csv.rb
Constant Summary collapse
- FIELDS =
%w{ branch commit_hash date file line_number status exception time query_count query_time query_percentage request_count request_time request_percentage description }.freeze
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize ⇒ Csv
constructor
A new instance of Csv.
- #insert(data) ⇒ Object
Constructor Details
#initialize ⇒ Csv
Returns a new instance of Csv.
30 31 32 33 34 |
# File 'lib/rspeckled/reporting/outputs/csv.rb', line 30 def initialize FileUtils.mkdir_p('log') self.output = CSV.open('log/rspec_report.csv', 'a').tap { |csv| csv << FIELDS } end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
28 29 30 |
# File 'lib/rspeckled/reporting/outputs/csv.rb', line 28 def output @output end |
Instance Method Details
#insert(data) ⇒ Object
36 37 38 39 40 |
# File 'lib/rspeckled/reporting/outputs/csv.rb', line 36 def insert(data) output << FIELDS.map do |field| data.fetch(field.to_sym) end end |