danger-gem_changes 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a1b559abd29ece1800694f42e76a86d23d76902ad050b077fd2b0fd65835d3d
4
- data.tar.gz: 0a97f435483472da2d0ddc1967f327b642d9a8d9bb74dec0d1ac812f5bfe21c1
3
+ metadata.gz: 1fa9c080dfc155ec38268174f825848bff64fbbe2e752be5f142d18086c887cd
4
+ data.tar.gz: 04b94a88454a9ae93127adb8ad4322a65c7b17dc0af75f39a4ee8ed711d7b0fb
5
5
  SHA512:
6
- metadata.gz: fb6de489fbed7d6df7f3be17148e0eb8c3b0081c12b624cc128bb24e93f7633131b470072d417c875f5d4bb84868de49824f3df66dc8c1f34a9229411dd4b006
7
- data.tar.gz: 854c978b2c48d5322d2b6be3ac30ed543fa25e4ef2b8b9ae81893bc47ec69c83ab3019604f844a6c7331cf6166ab8526f0f9c5e691f4eb786a4dd8013da5ecf1
6
+ metadata.gz: a60b5ce13398d355fd17b9ce5c7c6ea21386843d4582aa11b7b218e3cac5ab7d08a1b1cbeafe8101635bb43d443ad187700157fb97b4e29e32ef172e0e27b7b7
7
+ data.tar.gz: 1f01989b792ae9f1ff4dc6f683ee4cf3ca372ab8e1e71f029a82faf12d47ca4318fe98fe48c200530e041345becf39655c60596dfc81b76bff0cf27faaee1d75
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-gem_changes (0.0.5)
4
+ danger-gem_changes (0.0.7)
5
5
  danger-plugin-api (~> 1.0)
6
6
  nokogiri (~> 1.0)
7
7
 
data/README.md CHANGED
@@ -24,9 +24,9 @@ gem_changes.summarize_changes
24
24
  > ### Gemfile.lock Changes
25
25
  > | Gem | Source | Changelog | Change | Version | Level |
26
26
  > | :-: | :----: | :-------: | :----: | :-----: | :---: |
27
- > | [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | Downgraded | [2.25.0 <- 2.25.1](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
27
+ > | [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | Downgraded | [2.25.1 2.25.0](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
28
28
  > | [rubocop-performance](https://rubygems.org/gems/rubocop-performance) | [Source](https://github.com/rubocop/rubocop-performance) | [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) | Added | 1.21.0 | |
29
- > | [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | Upgraded | [0.5.0 -> 0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
29
+ > | [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | Upgraded | [0.5.0 0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
30
30
  > | [rubocop-rspec](https://rubygems.org/gems/rubocop-rspec) | [Source](https://github.com/rubocop/rubocop-rspec) | [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) | Removed | 2.29.2 | |
31
31
 
32
32
  ### Changes DSL
data/lib/danger_plugin.rb CHANGED
@@ -3,24 +3,18 @@
3
3
  require "gem_changes"
4
4
 
5
5
  module Danger
6
- # This is your plugin class. Any attributes or methods you expose here will
7
- # be available from within your Dangerfile.
6
+ # A Danger plugin that can help code review for PRs that have changes to Gemfile.lock.
8
7
  #
9
- # To be published on the Danger plugins site, you will need to have
10
- # the public interface documented. Danger uses [YARD](http://yardoc.org/)
11
- # for generating documentation from your plugin source, and you can verify
12
- # by running `danger plugins lint` or `bundle exec rake spec`.
8
+ # @example Print a markdown table summarizing all gem dependency changes
13
9
  #
14
- # You should replace these comments with a public description of your library.
15
- #
16
- # @example Ensure people are well warned about merging on Mondays
17
- #
18
- # my_plugin.warn_on_mondays
19
- #
20
- # @see Aesthetikx/danger-gems
21
- # @tags monday, weekends, time, rattata
10
+ # gem_changes.summarize_changes
22
11
  #
12
+ # @see Aesthetikx/danger-gem_changes
23
13
  class DangerGemChanges < Plugin
14
+ # Print a summary of the changes to the Gemfile.lock.
15
+ # @param changes [Array<GemChanges::Change>] An optional list of changes to summarize, defaulting to all changes.
16
+ # @param title [String] An optional title for the header.
17
+ # @return [void]
24
18
  def summarize_changes(changes: self.changes, title: "Gemfile.lock Changes")
25
19
  return if changes.empty?
26
20
 
@@ -31,22 +25,32 @@ module Danger
31
25
  markdown string
32
26
  end
33
27
 
28
+ # All dependencies that have changed.
29
+ # @return [Array<GemChanges::Change>]
34
30
  def changes
35
31
  GemChanges::Gemfile.changes(git:)
36
32
  end
37
33
 
34
+ # New dependencies that have been added.
35
+ # @return [Array<GemChanges::Change>]
38
36
  def additions
39
37
  changes.select(&:addition?)
40
38
  end
41
39
 
40
+ # Dependencies that have been removed.
41
+ # @return [Array<GemChanges::Change>]
42
42
  def removals
43
43
  changes.select(&:removal?)
44
44
  end
45
45
 
46
+ # Dependencies that were upgraded.
47
+ # @return [Array<GemChanges::Change>]
46
48
  def upgrades
47
49
  changes.select(&:upgrade?)
48
50
  end
49
51
 
52
+ # Dependencies that were downgraded.
53
+ # @return [Array<GemChanges::Change>]
50
54
  def downgrades
51
55
  changes.select(&:downgrade?)
52
56
  end
@@ -97,9 +97,9 @@ module GemChanges
97
97
  elsif change.removal?
98
98
  change.from
99
99
  elsif change.upgrade?
100
- "#{change.from} -> #{change.to}"
100
+ "#{change.from} #{change.to}"
101
101
  elsif change.downgrade?
102
- "#{change.to} <- #{change.from}"
102
+ "#{change.from} #{change.to}"
103
103
  else
104
104
  fail "Unknown change type"
105
105
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemChanges
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.7"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  ### Gemfile.lock Changes
2
2
  | Gem | Source | Changelog | Change | Version | Level |
3
3
  | :-: | :----: | :-------: | :----: | :-----: | :---: |
4
- | [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | Downgraded | [2.25.0 <- 2.25.1](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
4
+ | [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | Downgraded | [2.25.1 2.25.0](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
5
5
  | [rubocop-performance](https://rubygems.org/gems/rubocop-performance) | [Source](https://github.com/rubocop/rubocop-performance) | [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) | Added | 1.21.0 | |
6
- | [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | Upgraded | [0.5.0 -> 0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
6
+ | [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | Upgraded | [0.5.0 0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
7
7
  | [rubocop-rspec](https://rubygems.org/gems/rubocop-rspec) | [Source](https://github.com/rubocop/rubocop-rspec) | [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) | Removed | 2.29.2 | |
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-gem_changes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - John DeSilva