Class: Herodotus::Reporter
- Inherits:
-
Object
- Object
- Herodotus::Reporter
- Defined in:
- lib/herodotus/reporter.rb
Instance Attribute Summary collapse
-
#changelog_filename ⇒ Object
Returns the value of attribute changelog_filename.
-
#collector ⇒ Object
readonly
Returns the value of attribute collector.
Instance Method Summary collapse
- #append_to_changelog ⇒ Object
-
#initialize(collector) ⇒ Reporter
constructor
A new instance of Reporter.
- #print ⇒ Object
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_filename ⇒ Object
Returns the value of attribute changelog_filename.
4 5 6 |
# File 'lib/herodotus/reporter.rb', line 4 def changelog_filename @changelog_filename end |
#collector ⇒ Object (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_changelog ⇒ Object
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 |
#print ⇒ Object
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 |