Class: Danger::DangerGemChanges
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerGemChanges
- Defined in:
- lib/danger_plugin.rb
Overview
A Danger plugin that can help code review for PRs that have changes to Gemfile.lock.
Instance Method Summary collapse
-
#additions ⇒ Array<GemChanges::Change>
New dependencies that have been added.
-
#changes ⇒ Array<GemChanges::Change>
All dependencies that have changed.
-
#downgrades ⇒ Array<GemChanges::Change>
Dependencies that were downgraded.
-
#removals ⇒ Array<GemChanges::Change>
Dependencies that have been removed.
-
#summarize_changes(changes: self.changes, title: "Gemfile.lock Changes") ⇒ void
Print a summary of the changes to the Gemfile.lock.
-
#upgrades ⇒ Array<GemChanges::Change>
Dependencies that were upgraded.
Instance Method Details
#additions ⇒ Array<GemChanges::Change>
New dependencies that have been added.
36 37 38 |
# File 'lib/danger_plugin.rb', line 36 def additions changes.select(&:addition?) end |
#changes ⇒ Array<GemChanges::Change>
All dependencies that have changed.
30 31 32 |
# File 'lib/danger_plugin.rb', line 30 def changes GemChanges::Gemfile.changes(git:) end |
#downgrades ⇒ Array<GemChanges::Change>
Dependencies that were downgraded.
54 55 56 |
# File 'lib/danger_plugin.rb', line 54 def downgrades changes.select(&:downgrade?) end |
#removals ⇒ Array<GemChanges::Change>
Dependencies that have been removed.
42 43 44 |
# File 'lib/danger_plugin.rb', line 42 def removals changes.select(&:removal?) end |
#summarize_changes(changes: self.changes, title: "Gemfile.lock Changes") ⇒ void
This method returns an undefined value.
Print a summary of the changes to the Gemfile.lock.
18 19 20 21 22 23 24 25 26 |
# File 'lib/danger_plugin.rb', line 18 def summarize_changes(changes: self.changes, title: "Gemfile.lock Changes") return if changes.empty? string = "### #{title}\n" string += GemChanges::SummaryTable.new(changes:).markdown markdown string end |
#upgrades ⇒ Array<GemChanges::Change>
Dependencies that were upgraded.
48 49 50 |
# File 'lib/danger_plugin.rb', line 48 def upgrades changes.select(&:upgrade?) end |