Sha256: 43cd2a73a272510d98a1a402f5ccfd4915dba8d5d823b305be9f143a61897d94
Contents?: true
Size: 685 Bytes
Versions: 19
Compression:
Stored size: 685 Bytes
Contents
module KnifeSpork module Plugins # Load each of the drop-in plugins Dir[File.expand_path('../plugins/**/*.rb', __FILE__)].each { |f| require f } def self.run(options = {}) hook = options[:hook].to_sym klasses.each do |klass| plugin = klass.new(options) plugin.send(hook) if plugin.respond_to?(hook) && plugin.enabled? end end # Get and return a list of all subclasses (plugins) that are not the base plugin 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 end end
Version data entries
19 entries across 19 versions & 1 rubygems