https://github.com/pegasd/keepthechange
Parse CHANGELOGs
https://github.com/pegasd/keepthechange
changelog
Last synced: about 1 year ago
JSON representation
Parse CHANGELOGs
- Host: GitHub
- URL: https://github.com/pegasd/keepthechange
- Owner: pegasd
- License: mit
- Created: 2017-07-29T12:23:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-21T21:12:34.000Z (over 8 years ago)
- Last Synced: 2024-04-26T08:20:45.696Z (about 2 years ago)
- Topics: changelog
- Language: Ruby
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# KeepTheChange
[](https://badge.fury.io/rb/keepthechange)
[](https://travis-ci.org/pegasd/keepthechange)
[](https://coveralls.io/github/pegasd/keepthechange)
This gem provides an easy-to-use interface for parsing CHANGELOG files that strictly adhere to
[keep a changelog format](http://keepachangelog.com/).
The idea is loosely based on [vandamme](https://github.com/tech-angels/vandamme) gem, but is supposed to evolve
into something more strict (in terms of supported formats), but also more feature-rich.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'keepthechange'
```
And then execute:
```bash
$ bundle
```
Or install it yourself as:
```bash
$ gem install keepthechange
```
## Usage
### Parsed Changes Hash
```ruby
parser = KeepTheChange::Parser.new(changelog: File.read('CHANGELOG.md'))
changes_hash = parser.parse
```
This will produce a hash where keys are version numbers (e.g. `0.1.0`, `1.0.3`) and values are hashes themselves.
Those will have headers as keys (e.g. `Added`, `Fixed`) and changesets as corresponding values.
### Combine Multiple Changesets
If you only provide one argument to `combine_changes()`, the resulting output will contain changes since that
version.
```ruby
File.write('SINCE_0.1.7.md', parser.combine_changes('0.1.7'))
```
> `0.1.7` itself won't be included in the resulting file.
Specify both the lower and upper bound (again - lower bound is exclusive) to produce output with changes between the versions.
```ruby
File.write('0.1.7-1.0.3.md', parser.combine_changes('0.1.7', '1.0.3'))
```
## Development
After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also
run `bin/simple_test` after putting a `TEST_CHANGELOG.md` into the repo directory for a basic parsing test.
To install this gem onto your local machine, run `bundle exec rake install`.
## Contributing
Bug reports, feature requests and pull requests are welcome at [KeepTheChange official repo](https://github.com/pegasd/keepthechange).
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the Keepthechange project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the
[Code of Conduct](https://github.com/pegasd/keepthechange/blob/master/CODE_OF_CONDUCT.md).