Sha256: 340635bbf40202b3de07163ee25d23be5ac76362e21fe7bb80483ad8c64e1b26

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

puts "...loading Locomotive engine"

require 'locomotive/dependencies'
require 'locomotive'

$:.unshift File.dirname(__FILE__) # TODO: not sure about that, looks pretty useless

module Locomotive
  class Engine < Rails::Engine

    isolate_namespace Locomotive

    # config.autoload_once_paths += %W( #{config.root}/app/controllers #{config.root}/app/models #{config.root}/app/helpers #{config.root}/app/uploaders)

    initializer 'locomotive.cells' do |app|
      Cell::Base.prepend_view_path("#{config.root}/app/cells")
    end

    initializer 'locomotive.action_controller' do |app|
      ::ActionController::Base.wrap_parameters :format => [:json]
    end

    initializer "Locomotive precompile hook" do |app|
      app.config.assets.precompile += %w(locomotive.js locomotive.css locomotive/inline_editor.js locomotive/inline_editor.css
      locomotive/not_logged_in.js locomotive/not_logged_in.css
      locomotive/aloha.js)

      # very useful to see what happens during the precompilation of the assets
      def compile_asset?(path)
        puts "Compiling: #{path}"
        true
      end

      app.config.assets.precompile = [ method(:compile_asset?).to_proc ]

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locomotive_cms-2.0.0.rc1 lib/locomotive/engine.rb