module PluggableLite::PluginManager

Public Class Methods

extended(kclass) click to toggle source
# File lib/pluggable_lite.rb, line 6
    def self.extended(kclass)
      kclass.class_eval <<-EOS
        def self.plugins
          @@_plugins ||= []
        end
      EOS
    end

Public Instance Methods

load(path) click to toggle source
# File lib/pluggable_lite.rb, line 14
def load(path)
  Dir.glob(File.join(path, "*.rb")).each do |plugin|
    require File.join ".", "#{plugin}"
  end
end
register(kclass) click to toggle source
# File lib/pluggable_lite.rb, line 20
    def register(kclass)
      kclass.class_eval <<-EOS
        def self.plugin_manager
          #{self}
        end
      EOS
    end