danger-gem_changes 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/danger_plugin.rb +18 -14
- data/lib/gem_changes/version.rb +1 -1
- 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/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
|
data/lib/gem_changes/version.rb
CHANGED