Sha256: aff8ab6c5f0f418850e2235591ceb662e8b0638ebbb0580710f348b09c47e0b0

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

#!/usr/bin/env ruby

require "bundler/setup"
require "lirc"

version_number = LIRC::VERSION.gsub('.', '\\.')

state = :waiting_for_version
File.open('CHANGELOG.md', 'r').each_line do |line|
  case state
  when :waiting_for_version
    if line =~ /\A## \[(.+?)\]/
      latest_version = Regexp.last_match[1]
      if latest_version == LIRC::VERSION
        puts line
        state = :reading_changelog
      else
        raise "Expected latest version in changelog to be '#{LIRC::VERSION}', was '#{latest_version}'"
      end
    end
  when :reading_changelog
    if line =~ /\A## /
      state = :done
    else
      puts line
    end
  end
  break if state == :done
end
if state != :done
  raise "Got to end of file in #{state} state?"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lirc-0.3.0 bin/extract-changelog