Module: Yaks::Changelog

Defined in:
lib/yaks/changelog.rb

Class Method Summary collapse

Class Method Details

.currentObject



5
6
7
# File 'lib/yaks/changelog.rb', line 5

def current
  versions[Yaks::VERSION]
end

.markdownObject



17
18
19
# File 'lib/yaks/changelog.rb', line 17

def markdown
  Pathname(__FILE__).join('../../../../CHANGELOG.md').read
end

.versionsObject



9
10
11
12
13
14
15
# File 'lib/yaks/changelog.rb', line 9

def versions
  markdown.split(/(?=###\s*[\d\w\.]+\n)/).each_with_object({}) do |section, hsh|
    version = section.each_line.first[/[\d\w\.]+/]
    log     = section.each_line.drop(1).join.strip
    hsh[version] = log
  end
end