Class: Danger::Plugin
- Inherits:
-
Object
- Object
- Danger::Plugin
- Defined in:
- lib/danger/plugin_support/plugin.rb
Direct Known Subclasses
DangerfileDangerPlugin, DangerfileGitHubPlugin, DangerfileGitLabPlugin, DangerfileGitPlugin, DangerfileMessagingPlugin
Class Method Summary collapse
- .all_plugins ⇒ Object
- .clear_external_plugins ⇒ Object
- .inherited(plugin) ⇒ Object
- .instance_name ⇒ Object
Instance Method Summary collapse
-
#initialize(dangerfile) ⇒ Plugin
constructor
A new instance of Plugin.
-
#method_missing(method_sym, *arguments, &block) ⇒ Object
rubocop:disable Style/MethodMissing.
Constructor Details
#initialize(dangerfile) ⇒ Plugin
Returns a new instance of Plugin.
3 4 5 |
# File 'lib/danger/plugin_support/plugin.rb', line 3 def initialize(dangerfile) @dangerfile = dangerfile end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *arguments, &block) ⇒ Object
rubocop:disable Style/MethodMissing
22 23 24 |
# File 'lib/danger/plugin_support/plugin.rb', line 22 def method_missing(method_sym, *arguments, &block) @dangerfile.send(method_sym, *arguments, &block) end |
Class Method Details
.all_plugins ⇒ Object
26 27 28 |
# File 'lib/danger/plugin_support/plugin.rb', line 26 def self.all_plugins @all_plugins ||= [] end |
.clear_external_plugins ⇒ Object
30 31 32 |
# File 'lib/danger/plugin_support/plugin.rb', line 30 def self.clear_external_plugins @all_plugins = @all_plugins.select { |plugin| Dangerfile.essential_plugin_classes.include? plugin } end |
.inherited(plugin) ⇒ Object
34 35 36 |
# File 'lib/danger/plugin_support/plugin.rb', line 34 def self.inherited(plugin) Plugin.all_plugins.push(plugin) end |
.instance_name ⇒ Object
7 8 9 |
# File 'lib/danger/plugin_support/plugin.rb', line 7 def self.instance_name to_s.gsub("Danger", "").danger_underscore.split("/").last end |