module Crystal module Plugin class App attr_reader :dir def initialize dir @dir = dir end def plugins list plugins = Array.wrap(list) # add to $LOAD_PATH # plugins.each{|plugin| $LOAD_PATH << "#{dir}/#{plugin}" unless $LOAD_PATH.include?("#{dir}/#{plugin}")} # call plugin's init plugins.each{|plugin| require "#{plugin}/config/init" if File.exist? "#{dir}/#{plugin}/config/init.rb"} end end end end