Module: KnifeSpork::Plugins
- Defined in:
- lib/knife-spork/plugins.rb,
lib/knife-spork/plugins/git.rb,
lib/knife-spork/plugins/irccat.rb,
lib/knife-spork/plugins/jabber.rb,
lib/knife-spork/plugins/plugin.rb,
lib/knife-spork/plugins/hipchat.rb,
lib/knife-spork/plugins/campfire.rb,
lib/knife-spork/plugins/graphite.rb,
lib/knife-spork/plugins/foodcritic.rb,
lib/knife-spork/plugins/eventinator.rb
Defined Under Namespace
Classes: Campfire, Eventinator, Foodcritic, Git, Graphite, HipChat, Irccat, Jabber, Plugin
Class Method Summary collapse
-
.klasses ⇒ Object
Get and return a list of all subclasses (plugins) that are not the base plugin.
- .run(options = {}) ⇒ Object
Class Method Details
.klasses ⇒ Object
Get and return a list of all subclasses (plugins) that are not the base plugin
16 17 18 19 20 |
# File 'lib/knife-spork/plugins.rb', line 16 def self.klasses @@klasses ||= self.constants.collect do |c| self.const_get(c) if self.const_get(c).is_a?(Class) && self.const_get(c) != KnifeSpork::Plugins::Plugin end.compact end |
.run(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/knife-spork/plugins.rb', line 6 def self.run( = {}) hook = [:hook].to_sym klasses.each do |klass| plugin = klass.new() plugin.send(hook) if plugin.respond_to?(hook) && plugin.enabled? end end |