Coder Social home page Coder Social logo

danger-gem_changes's Introduction

danger-gem_changes

This is a Danger plugin that can assist with reviews involving Gemfile dependency changes. It can display a helpful table with links to changelogs and diffs, and provides a DSL for evaluating changes to your depdencies.

Installation

$ gem install danger-gem_changes

Usage

The following examples are changes to your Dangerfile.

Summary Table

# Print a markdown table summarizing Gemfile.lock changes, if any.
gem_changes.summarize_changes

Gemfile.lock Changes

Gem Source Changelog Change Version Level
rubocop-factory_bot Source Changelog Downgraded 2.25.1 โž˜ 2.25.0 Patch
rubocop-performance Source Changelog Added 1.21.0
rubocop-rake Source Changelog Upgraded 0.5.0 โžš 0.6.0 Minor
rubocop-rspec Source Changelog Removed 2.29.2

Changes DSL

This gem provides a DSL for accessing metadata about changes to your Gemfile dependencies:

Method Description
changes All dependency changes
additions Dependencies that were not present before
removals Dependencies that are no longer present
upgrades Dependencies that have a newer version than before
downgrades Dependencies that have a lower version than before

Each dependency change has information about the gem and version change:

Method Example
gem.name rubocop-rake
from 0.6.0
to 0.6.1
change? true
addition? false
removal? false
upgrade? true
downgrade? false

The from attribute will be nil for additions, and to will be nil for removals.

More Examples

# Print a warning if new dependencies were added.
warn "Dependencies added" if gem_changes.additions.any?
# Print a table of dependency downgrades, if any
downgrades = gem_changes.downgrades
gem_changes.summarize_changes changes: downgrades, title: "Dependency Downgrades"

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.

danger-gem_changes's People

Contributors

aesthetikx avatar

Stargazers

Matheus Poli avatar Sam Bostock avatar Neenu Chacko avatar James Mead avatar

Watchers

 avatar

danger-gem_changes's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.