lib/coco/engine.rb in coveragebook_components-0.12.2 vs lib/coco/engine.rb in coveragebook_components-0.13.0
- old
+ new
@@ -5,11 +5,11 @@
module Coco
class Engine < ::Rails::Engine
isolate_namespace Coco
- COLLAPSE_DIRS = %w[shared]
+ COLLAPSE_DIRS = %w[shared layout messaging pickers buttons modals navigation utilities typography images indicators embeds]
config.autoload_paths += %W[
#{root}/app/components
#{root}/app/helpers
]
@@ -20,14 +20,14 @@
app.autoloaders.each do |autoloader|
COLLAPSE_DIRS.each do |path|
autoloader.collapse("#{coco_dir}/#{path}")
end
- Dir.glob("#{coco_dir}/shared/**/*.rb").each do |path|
+ Dir.glob("#{coco_dir}/{#{COLLAPSE_DIRS.join(",")}}/**/*.rb").each do |path|
autoloader.collapse(File.dirname(path))
end
- Dir.glob("#{coco_dir}/{app,book}/{blocks,elements,layouts}/**/*.rb").each do |path|
+ Dir.glob("#{coco_dir}/{app,book}/**/*.rb").each do |path|
autoloader.collapse(File.dirname(path))
end
end
if Rails.env.production?