Class: Cuker::JiraFile

Inherits:
AbstractFile show all
Defined in:
lib/cuker/helpers/writers/jira_writer.rb

Instance Attribute Summary

Attributes inherited from AbstractFile

#name, #rows

Attributes included from LoggerSetup

#log

Instance Method Summary collapse

Methods inherited from AbstractFile

#add_row, #current_row, #finishup

Methods included from LoggerSetup

#init_logger, reset_appender_log_levels

Constructor Details

#initialize(file_name) ⇒ JiraFile

Returns a new instance of JiraFile.



38
39
40
41
42
43
# File 'lib/cuker/helpers/writers/jira_writer.rb', line 38

def initialize file_name
  super file_name
  @log.debug "Making new #{self.class} => #{file_name}"
  @jira_file = File.open(file_name, "wb")
  @jira_file.close
end

Instance Method Details

#add_line(line) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/cuker/helpers/writers/jira_writer.rb', line 45

def add_line line
  super line
  @log.error "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

Returns ary of rows.

Returns:

  • ary of rows



54
55
56
# File 'lib/cuker/helpers/writers/jira_writer.rb', line 54

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