Sha256: 41ae99ed27e1046024ecd0a13f5219d1605b93e51482913f4754dcc7f1588e36

Contents?: true

Size: 938 Bytes

Versions: 6

Compression:

Stored size: 938 Bytes

Contents

# encoding: utf-8
require 'cells'

# Tell *Rails* to load files in path:
#
#   * +app/cells+
#
ActiveSupport::Dependencies.load_paths << Rails.root.join(*%w[app cells])

# Rails initialization hook.
if defined?(Rails)
  Rails.configuration.after_initialize do
    initializer.loaded_plugins.each do |plugin|
      engine_cells_dir = File.join(plugin.directory, *%w[app cells])

      if plugin.engine? && File.exists?(engine_cells_dir)
        # propagate the view- and code path of this engine-cell:
        ::Cell::Base.view_paths << engine_cells_dir
        ::ActiveSupport::Dependencies.load_paths << engine_cells_dir

        # if a path is in +load_once_path+ it won't be reloaded between requests.
        unless config.reload_plugins?
          ::ActiveSupport::Dependencies.load_once_paths << engine_cells_dir
        end
      end
    end
  end
else
  puts "[cells:] NOTE: Rails environment not available. Running isolated."
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cells-3.3.5 rails/init.rb
cells-3.3.4 rails/init.rb
cells-3.3.3 rails/init.rb
cells-3.3.2 rails/init.rb
cells-3.3.1 rails/init.rb
cells-3.3.0 rails/init.rb