LockDiff

Gem Version GitHub tag Build Status Dependency Status Code Climate Issue Count ghit.me

This gem detects changes to your package manager (e.g. Gemfile) and generates a Markdown-formatted diff including:

  • links to the corresponding package's change logs
  • Github ...-delineated diff links for the relevant changes

It also optionally posts the diff as a comment to the pull request responsible for the package update.

Like this.

https://github.com/vividmuimui/lock_diff_sample/pull/9#issuecomment-315140796 image

Strategies

  • Gemfile.lock(Ruby/Bundler)

Installation

Add this line to your application's Gemfile:

gem 'lock_diff'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lock_diff

Usage

lock_diff requires you to provide a GITHUB_ACCESS_TOKEN as an environment variable.

Command line

$ lock_diff
Usage: lock_diff [options]
Require flags
    -r, --repository=REPOSITORY      Like as "user/repository"
    -n, --number=PULL_REQUEST_NUMBER

Optional flags
        --post-comment=true or false Print result to stdout when false. (default is false)
    -v, --verbose                    Run verbosely
        --version                    Show version

For example, to comment on https://github.com/vividmuimui/lock_diff_sample/pull/9#issuecomment-315140796, run this command:

$ lock_diff -r "vividmuimui/lock_diff_sample" -n 9 --post-comment=false

Ruby

require 'lock_diff'
LockDiff.run(repository: "vividmuimui/lock_diff_sample", number: 9, post_comment: false)

For Tachikoma pull request

When used in conjunction with tachikoma, use the lock_diff_for_tachikoma command instead of lock_diff. lock_diff_for_tachikoma automatically detects and comments on the most recent tachikoma pull request.

Command line

$ lock_diff_for_tachikoma
Usage: lock_diff_for_tachikoma [options]
Require flags
    -r, --repository=REPOSITORY      Like as "user/repository"

Optional flags
        --post-comment=true or false Print result to stdout when false. (default is false)
    -v, --verbose                    Run verbosely
        --version                    Show version
$ lock_diff_for_tachikoma -r "vividmuimui/lock_diff_sample" --post-comment=false

Ruby

require 'lock_diff'
LockDiff.lock_diff_for_tachikoma(repository: "vividmuimui/lock_diff_sample", post_comment: false)

Development

TODO:

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lock_diff. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the LockDiff project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.