Class: Herodotus::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/herodotus/reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collector) ⇒ Reporter

Returns a new instance of Reporter.



6
7
8
9
# File 'lib/herodotus/reporter.rb', line 6

def initialize(collector)
  @collector          = collector
  @changelog_filename = Configuration.config.changelog_filename
end

Instance Attribute Details

#changelog_filenameObject

Returns the value of attribute changelog_filename.



4
5
6
# File 'lib/herodotus/reporter.rb', line 4

def changelog_filename
  @changelog_filename
end

#collectorObject (readonly)

Returns the value of attribute collector.



3
4
5
# File 'lib/herodotus/reporter.rb', line 3

def collector
  @collector
end

Instance Method Details

#append_to_changelogObject



17
18
19
20
21
22
23
# File 'lib/herodotus/reporter.rb', line 17

def append_to_changelog
  File.open(changelog_filename, 'a') do |file|
    @collector.changes.each do |change|
      file.puts change.log_entry
    end
  end
end


11
12
13
14
15
# File 'lib/herodotus/reporter.rb', line 11

def print
  @collector.changes.each do |change|
    puts change.log_entry
  end
end