Class: Danger::DangerfileImportPlugin
- Defined in:
- lib/danger/danger_core/plugins/dangerfile_import_plugin.rb
Overview
One way to support internal plugins is via ‘plugin.import` this gives you the chance to quickly iterate without the need for building rubygems. As such, it does not have the stringent rules around documentation expected of a public plugin. It’s worth noting, that you can also have plugins inside ‘./danger_plugins` and they will be automatically imported into your Dangerfile at launch.
Plugins collapse
-
#import(path) ⇒ Object
Download a local or remote plugin and use it inside the Dangerfile.
Class Method Summary collapse
Methods inherited from Plugin
all_plugins, clear_external_plugins, inherited, #initialize, #method_missing
Constructor Details
This class inherits a constructor from Danger::Plugin
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Danger::Plugin
Class Method Details
.instance_name ⇒ Object
27 28 29 |
# File 'lib/danger/danger_core/plugins/dangerfile_import_plugin.rb', line 27 def self.instance_name "plugin" end |
Instance Method Details
#import(path) ⇒ Object
Download a local or remote plugin and use it inside the Dangerfile.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/danger/danger_core/plugins/dangerfile_import_plugin.rb', line 37 def import(path) raise "`import` requires a string" unless path.kind_of?(String) path += ".rb" unless path.end_with?(".rb") if path.start_with?("http") import_url(path) else import_local(path) end end |