2010-10-17 01:18:41 +00:00
|
|
|
puts "...loading Locomotive engine"
|
2010-06-03 15:32:40 +00:00
|
|
|
|
2012-01-20 13:46:09 +00:00
|
|
|
require 'locomotive/dependencies'
|
|
|
|
require 'locomotive'
|
|
|
|
|
|
|
|
$:.unshift File.dirname(__FILE__) # TODO: not sure about that, looks pretty useless
|
|
|
|
|
2010-06-03 15:32:40 +00:00
|
|
|
module Locomotive
|
|
|
|
class Engine < Rails::Engine
|
|
|
|
|
2011-10-31 23:44:23 +00:00
|
|
|
isolate_namespace Locomotive
|
|
|
|
|
2011-11-21 01:27:05 +00:00
|
|
|
# config.autoload_once_paths += %W( #{config.root}/app/controllers #{config.root}/app/models #{config.root}/app/helpers #{config.root}/app/uploaders)
|
2011-03-06 22:36:30 +00:00
|
|
|
|
2011-10-30 23:02:41 +00:00
|
|
|
initializer 'locomotive.cells' do |app|
|
2011-07-27 13:56:56 +00:00
|
|
|
Cell::Base.prepend_view_path("#{config.root}/app/cells")
|
|
|
|
end
|
|
|
|
|
2011-11-10 01:43:19 +00:00
|
|
|
initializer 'locomotive.action_controller' do |app|
|
2012-01-09 14:49:59 +00:00
|
|
|
::ActionController::Base.wrap_parameters :format => [:json]
|
2011-11-10 01:43:19 +00:00
|
|
|
end
|
|
|
|
|
2012-01-20 13:46:09 +00:00
|
|
|
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)
|
|
|
|
|
2012-01-21 00:48:00 +00:00
|
|
|
# very useful to see what happens during the precompilation of the assets
|
2012-01-20 13:46:09 +00:00
|
|
|
def compile_asset?(path)
|
2012-01-21 00:48:00 +00:00
|
|
|
puts "Compiling: #{path}"
|
|
|
|
true
|
2012-01-20 13:46:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
app.config.assets.precompile = [ method(:compile_asset?).to_proc ]
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2010-06-03 15:32:40 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|