def load_plugins
@loaded ||= {}
found = {}
Gem.find_files(File.join(plugin_path, '*.rb')).sort!.reverse_each do |path|
name = File.basename(path, '.rb').to_sym
found[name] = path unless found.key? name
end
:keep_on_truckin while found.map { |name, path|
next unless plugin_names.empty? or plugin_names.include? name
next if disregard_plugins.include? name
next if @loaded[name]
begin
@loaded[name] = load path
rescue ScriptError, StandardError => err
warn "Error loading #{path.inspect}: #{err.message}. skipping..."
end
}.any?
end