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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/danger_plugin.rb +18 -14
- data/lib/gem_changes/summary_table.rb +2 -2
- data/lib/gem_changes/version.rb +1 -1
- data/spec/fixtures/summary_table.markdown +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fa9c080dfc155ec38268174f825848bff64fbbe2e752be5f142d18086c887cd
|
4
|
+
data.tar.gz: 04b94a88454a9ae93127adb8ad4322a65c7b17dc0af75f39a4ee8ed711d7b0fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a60b5ce13398d355fd17b9ce5c7c6ea21386843d4582aa11b7b218e3cac5ab7d08a1b1cbeafe8101635bb43d443ad187700157fb97b4e29e32ef172e0e27b7b7
|
7
|
+
data.tar.gz: 1f01989b792ae9f1ff4dc6f683ee4cf3ca372ab8e1e71f029a82faf12d47ca4318fe98fe48c200530e041345becf39655c60596dfc81b76bff0cf27faaee1d75
|
data/Gemfile.lock
CHANGED
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.
|
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
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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}
|
100
|
+
"#{change.from} ➚ #{change.to}"
|
101
101
|
elsif change.downgrade?
|
102
|
-
"#{change.
|
102
|
+
"#{change.from} ➘ #{change.to}"
|
103
103
|
else
|
104
104
|
fail "Unknown change type"
|
105
105
|
end
|
data/lib/gem_changes/version.rb
CHANGED
@@ -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.
|
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
|
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 | |
|