mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-29 05:51:22 +00:00
18 lines
458 B
Ruby
18 lines
458 B
Ruby
|
Dir.glob(File.join(Rails.root, "lib/plugins/*")).sort.each do |directory|
|
||
|
if File.directory?(directory)
|
||
|
lib = File.join(directory, "lib")
|
||
|
|
||
|
if File.directory?(lib)
|
||
|
$:.unshift lib
|
||
|
ActiveSupport::Dependencies.autoload_paths += [lib]
|
||
|
end
|
||
|
|
||
|
initializer = File.join(directory, "init.rb")
|
||
|
|
||
|
if File.file?(initializer)
|
||
|
config = Ensl::Application.config
|
||
|
eval(File.read(initializer), binding, initializer)
|
||
|
end
|
||
|
end
|
||
|
end
|