Method: GitHubChangelogGenerator::Reader#initialize

Defined in:
lib/github_changelog_generator/reader.rb

#initialize(options = {}) ⇒ Reader

Returns a new instance of Reader.


28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/github_changelog_generator/reader.rb', line 28

def initialize(options = {})
  defaults = {
    heading_level: "##",
    heading_structures: [
      /^## \[(?<version>.+?)\]\((?<url>.+?)\)( \((?<date>.+?)\))?$/, # rubocop:disable Lint/MixedRegexpCaptureTypes
      /^## (?<version>.+?)( \((?<date>.+?)\))?$/ # rubocop:disable Lint/MixedRegexpCaptureTypes
    ]
  }

  @options = options.merge(defaults)

  @heading_level = @options[:heading_level]
  @heading_structures = @options[:heading_structures]
end