Class: Cuker::JiraFile
- Inherits:
-
AbstractFile
- Object
- AbstractFile
- Cuker::JiraFile
- Defined in:
- lib/cuker/helpers/writers/jira_writer.rb
Instance Attribute Summary
Attributes inherited from AbstractFile
Attributes included from LoggerSetup
Instance Method Summary collapse
- #add_line(line) ⇒ Object
-
#initialize(file_name) ⇒ JiraFile
constructor
A new instance of JiraFile.
-
#read_rows ⇒ Object
Ary of rows.
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_rows ⇒ Object
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 |