Class: JiraFile

Inherits:
AbstractSheet show all
Defined in:
lib/cuker/writer_helper/jira_writer.rb

Instance Attribute Summary

Attributes inherited from AbstractSheet

#name, #rows

Attributes included from LoggerSetup

#log

Instance Method Summary collapse

Methods inherited from AbstractSheet

#add_row, #current_row

Methods included from LoggerSetup

#init_logger, reset_appender_log_levels

Constructor Details

#initialize(path, ext) ⇒ JiraFile



36
37
38
39
40
# File 'lib/cuker/writer_helper/jira_writer.rb', line 36

def initialize path, ext
  file_name = "#{path}#{ext}"
  super file_name
  @csv_sheet = File.open(file_name, "wb")
end

Instance Method Details

#add_line(line) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/cuker/writer_helper/jira_writer.rb', line 42

def add_line line
  super line
  @log.warn "argument not a String.. instead is a '#{line.class}' -> '#{line}'" unless line.is_a? String
  File.open(@name, "ab") do |file|
    file << "#{line}\n"
  end
end

#read_rowsObject



51
52
53
# File 'lib/cuker/writer_helper/jira_writer.rb', line 51

def read_rows
  @rows = File.read(@name)
end