Sha256: 7e5b7fd336327b5bd46be9494e5591d904cdecc1cfd245dc08f44f275f9bb33d

Contents?: true

Size: 761 Bytes

Versions: 6

Compression:

Stored size: 761 Bytes

Contents

# Encoding: utf-8
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/)

    logs = []
    logs << '## Release notes'
    `git log --pretty=format:%s #{last_tag}..`
      .encode!('UTF-8')
      .split(/\n/)
      .each do |logline|
        logs << " * #{logline}"
    end
    logs
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
albacore-3.0.1 ./lib/albacore/tools.rb
albacore-3.0.0.pre.alpha.6 ./lib/albacore/tools.rb
albacore-3.0.0.pre.alpha.5 ./lib/albacore/tools.rb
albacore-3.0.0.pre.alpha.4 ./lib/albacore/tools.rb
albacore-3.0.0.pre.alpha.3 ./lib/albacore/tools.rb
albacore-3.0.0.pre.alpha.2 ./lib/albacore/tools.rb