Method: NewRelic::LatestChanges.extract_latest_changes

Defined in:
lib/new_relic/latest_changes.rb

.extract_latest_changes(contents) ⇒ Object

[View source]

51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/new_relic/latest_changes.rb', line 51

def self.extract_latest_changes(contents)
  changes = []
  version_count = 0
  contents.each_line do |line|
    if /##\s+v[\d.]+/.match?(line)
      version_count += 1
    end
    break if version_count >= 2

    changes << line.sub(/^  \* /, '* ').chomp
  end
  changes
end