Class: Semmy::Changelog::CloseSection

Inherits:
Struct
  • Object
show all
Defined in:
lib/semmy/changelog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config



9
10
11
# File 'lib/semmy/changelog.rb', line 9

def config
  @config
end

#optionsObject

Returns the value of attribute options



9
10
11
# File 'lib/semmy/changelog.rb', line 9

def options
  @options
end

Instance Method Details

#call(contents) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/semmy/changelog.rb', line 10

def call(contents)
  contents.dup.tap do |result|
    result.gsub!(unreleased_section_matcher,
                 version_header) ||
      fail(InsertPointNotFound, "        Could not find insert point for section heading in:\n\n        \#{contents}\n      END\n  end\nend\n".unindent)