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.
38 39 40 |
# File 'lib/danger_plugin.rb', line 38 def additions changes.select(&:addition?) end |
#changes ⇒ Array<GemChanges::Change>
All dependencies that have changed.
32 33 34 |
# File 'lib/danger_plugin.rb', line 32 def changes GemChanges::Gemfile.changes(git:) end |
#downgrades ⇒ Array<GemChanges::Change>
Dependencies that were downgraded.
56 57 58 |
# File 'lib/danger_plugin.rb', line 56 def downgrades changes.select(&:downgrade?) end |
#removals ⇒ Array<GemChanges::Change>
Dependencies that have been removed.
44 45 46 |
# File 'lib/danger_plugin.rb', line 44 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.
20 21 22 23 24 25 26 27 28 |
# File 'lib/danger_plugin.rb', line 20 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.
50 51 52 |
# File 'lib/danger_plugin.rb', line 50 def upgrades changes.select(&:upgrade?) end |