Sha256: 87c4471a2797bba48215ec8140f262c3d899633c7abcf2f18248fbfa4e2f9c0f

Contents?: true

Size: 626 Bytes

Versions: 1

Compression:

Stored size: 626 Bytes

Contents

require 'albacore'
require 'xsemver'

module Albacore::Tools
  # Try to get the release notes from git, but looking at the commit messages
  def self.git_release_notes
    tags = `git tag`.split(/\n/).
              map { |tag| [ ::XSemVer::SemVer.parse_rubygems(tag), tag ] }.
              sort { |a, b| a <=> b }.
              map { |_, tag| tag }
    last_tag = tags[-1]
    second_last_tag = tags[-2] || `git rev-list --max-parents=0 HEAD`
    logs = `git log --pretty=format:%s #{second_last_tag}..`.split(/\n/)
    "Release Notes for #{last_tag}:
#{logs.inject('') { |state, line| state + "\n * #{line}" }}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
albacore-2.3.12 lib/albacore/tools.rb