Sha256: ba99ea2508a397b8dd80e1370f4eb569a6f6e1292a6e760876b0f7aa8945ee1c

Contents?: true

Size: 889 Bytes

Versions: 15

Compression:

Stored size: 889 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

15 entries across 15 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.2.195 lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.2.192 lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.2.190.beta lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.1.188 lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.1.182 lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.1.180 lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.0.177 lib/new_relic/latest_changes.rb
newrelic_rpm-3.7.0.174.beta lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.9.171 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.8.168 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.8.164 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.7.159 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.7.159.beta lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.7.152 lib/new_relic/latest_changes.rb
newrelic_rpm-3.6.6.147 lib/new_relic/latest_changes.rb