Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.88 KB

README.rdoc

File metadata and controls

53 lines (36 loc) · 1.88 KB

changelog_parser

ChangelogParser splits a changelog into its seperate entries and tries to detect the corresponding version number and release date. It currently defaults to parsing the common ‘wikisyntax’ style, but differing formats can easily be added.

Installation

gem install jeweler
rake build
gem install pkg/changelog_parser-0.0.x.gem

Usage

From ruby:

require 'changelog_parser'
changelog = ChangelogParser::Reader.read "/path/to/CHANGELOG"
changelog.entries.size              # => 3

entry = changelog.entries.first
entry.version                       # => #<Gem::Version "1.2.3">
entry.date                          # => #<Date: 2005-04-06 (4906933/2,0,2299161)>
entry.text                          # => "== 1.2.3 / 2005-04-06\n\n  * some new feature added"

From the commandline:

$ changelog_parser CHANGELOG        # displays most recent entry
$ changelog_parser CHANGELOG -n3    # displays three entries
$ cat CHANGELOG | changlog_parser   # also reads from STDIN

$ changlog_parser -h
options:

    -n, --number      number of entries to print
    -h, --help        Print this help message

Contributing to changelog_parser

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Lars Henrik Mai. See LICENSE.txt for further details.