Sha256: 9ca4f960ce380c2f1039c9bec500a44cd34089e009aa0346e177e12f1eca5284

Contents?: true

Size: 468 Bytes

Versions: 15

Compression:

Stored size: 468 Bytes

Contents

require 'csv'

module Adhoq
  module Reporter
    class Csv

      def self.mime_type
        'text/csv; charset=UTF-8'
      end

      def initialize(result)
        @result = result
      end

      def build_report
        file = Tempfile.new(['adhoq-reporter', '.csv'], Dir.tmpdir, encoding: 'UTF-8')
        csv  = CSV.new(file)

        csv << @result.header
        @result.rows.each {|row| csv << row }

        file.tap(&:rewind)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
adhoq-1.0.2 lib/adhoq/reporter/csv.rb
adhoq-1.0.1 lib/adhoq/reporter/csv.rb
adhoq-1.0.0 lib/adhoq/reporter/csv.rb
adhoq-0.5.0 lib/adhoq/reporter/csv.rb
adhoq-0.5.0.beta1 lib/adhoq/reporter/csv.rb
adhoq-0.4.0 lib/adhoq/reporter/csv.rb
adhoq-0.3.0 lib/adhoq/reporter/csv.rb
adhoq-0.2.0 lib/adhoq/reporter/csv.rb
adhoq-0.1.2 lib/adhoq/reporter/csv.rb
adhoq-0.1.1 lib/adhoq/reporter/csv.rb
adhoq-0.1.0 lib/adhoq/reporter/csv.rb
adhoq-0.0.7 lib/adhoq/reporter/csv.rb
adhoq-0.0.6 lib/adhoq/reporter/csv.rb
adhoq-0.0.5 lib/adhoq/reporter/csv.rb
adhoq-0.0.4 lib/adhoq/reporter/csv.rb