Sha256: 1e4da09c758e8b7eb1c7bced41912e50e710e02fe5acce1fd0ff80489835a34b

Contents?: true

Size: 885 Bytes

Versions: 3

Compression:

Stored size: 885 Bytes

Contents

#!/usr/bin/ruby
# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.


module NewRelic
  module LatestChanges
    def self.default_changelog
      File.join(File.dirname(__FILE__), '..', '..', 'CHANGELOG')
    end

    def self.read(changelog=default_changelog)
      footer = <<'EOS'
See https://github.com/newrelic/rpm/blob/master/CHANGELOG for a full list of
changes.
EOS

      return footer unless File.exists?(changelog) 

      version_count = 0
      changes = []
      File.read(changelog).each_line do |line|
        if line.match(/##\s+v[\d.]+\s+##/)
          version_count += 1
        end
        break if version_count >= 2
        changes << line.sub(/^  /, "").chomp
      end

      changes << footer
      change_message =  changes.join("\n")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.0.83 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.0.78 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.0.74.beta lib/new_relic/latest_changes.rb