Class: Danger::DangerGemChanges
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerGemChanges
- Defined in:
- lib/danger_plugin.rb
Overview
This is your plugin class. Any attributes or methods you expose here will be available from within your Dangerfile.
To be published on the Danger plugins site, you will need to have the public interface documented. Danger uses [YARD](yardoc.org/) for generating documentation from your plugin source, and you can verify by running ‘danger plugins lint` or `bundle exec rake spec`.
You should replace these comments with a public description of your library.
Instance Method Summary collapse
- #additions ⇒ Object
- #changes ⇒ Object
- #downgrades ⇒ Object
- #removals ⇒ Object
- #summarize_changes(changes: self.changes, title: "Gemfile.lock Changes") ⇒ Object
- #upgrades ⇒ Object
Instance Method Details
#additions ⇒ Object
38 39 40 |
# File 'lib/danger_plugin.rb', line 38 def additions changes.select(&:addition?) end |
#changes ⇒ Object
34 35 36 |
# File 'lib/danger_plugin.rb', line 34 def changes GemChanges::Gemfile.changes(git: git) end |
#downgrades ⇒ Object
50 51 52 |
# File 'lib/danger_plugin.rb', line 50 def downgrades changes.select(&:downgrade?) end |
#removals ⇒ Object
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") ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/danger_plugin.rb', line 24 def summarize_changes(changes: self.changes, title: "Gemfile.lock Changes") return if changes.empty? string = "### #{title}\n" string += GemChanges::SummaryTable.new(changes: changes).markdown markdown string end |
#upgrades ⇒ Object
46 47 48 |
# File 'lib/danger_plugin.rb', line 46 def upgrades changes.select(&:upgrade?) end |