Class: OmgPullRequest::TestLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/omg_pull_request/test_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TestLogger

Returns a new instance of TestLogger.



4
5
6
7
8
# File 'lib/omg_pull_request/test_logger.rb', line 4

def initialize(attributes={})
  attributes.each do |attr, value|
    self.send("#{attr}=", value)
  end
end

Instance Attribute Details

#bufferObject

Returns the value of attribute buffer.



3
4
5
# File 'lib/omg_pull_request/test_logger.rb', line 3

def buffer
  @buffer
end

#storeObject

Returns the value of attribute store.



3
4
5
# File 'lib/omg_pull_request/test_logger.rb', line 3

def store
  @store
end

Instance Method Details

#log(output) ⇒ Object



10
11
12
13
# File 'lib/omg_pull_request/test_logger.rb', line 10

def log(output)
  puts output
  self.buffer = "#{buffer}\n#{output}"
end

#store_logs!(file_name) ⇒ Object



15
16
17
# File 'lib/omg_pull_request/test_logger.rb', line 15

def store_logs!(file_name)
  self.store.store(StringIO.new(buffer), file_name)
end