Class: Herodotus::Collector

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

Defined Under Namespace

Classes: Change

Constant Summary collapse

CHANGES_REGEX =
/changelog.*?\n(.*)/mi.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_path, since_ref = nil) ⇒ Collector

Returns a new instance of Collector.



6
7
8
9
10
11
# File 'lib/herodotus/collector.rb', line 6

def initialize(base_path, since_ref = nil)
  @git                = Git.new(base_path)
  @since_ref          = since_ref
  @changes            = []
  find_changes
end

Instance Attribute Details

#changelog_filenameObject

Returns the value of attribute changelog_filename.



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

def changelog_filename
  @changelog_filename
end

#changesObject

Returns the value of attribute changes.



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

def changes
  @changes
end

#gitObject

Returns the value of attribute git.



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

def git
  @git
end

#since_refObject

Returns the value of attribute since_ref.



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

def since_ref
  @since_ref
end

Instance Method Details

#append_to_changelogObject



29
30
31
# File 'lib/herodotus/collector.rb', line 29

def append_to_changelog
  reporter.append_to_changelog
end


25
26
27
# File 'lib/herodotus/collector.rb', line 25

def print
  reporter.print
end

#reporterObject



42
43
44
# File 'lib/herodotus/collector.rb', line 42

def reporter
  Herodotus::Reporter.new(self)
end