Posted by: mikepence on: March 22, 2008
[Update, March 25, 2008: Engines is now optional in the trunk of Cells.]
It seems that the Engines dependency in Cells is unnecessary, so I have documented the steps to remove it. You may want to wait for Nick Sutterer to commit this change to the svn repository, but if you are anxious to do it right away, here is what you need to do.
In vendor/plugins/cells_plugin/lib/action_view_extensions.rb, line 87, remove this block:
# Otherwise, check in the plugins to see if the template can be found there.
# Load this in order so that more recently started plugins will take priority.
Rails.plugins.by_precedence do |plugin|
plugin_specific_path = File.join(plugin.root, 'app', 'cells',
template_path.to_s + '.' + extension.to_s)
return plugin_specific_path if File.exist?(plugin_specific_path)
end
Next, in line 76, replace this:
if Engines.disable_application_view_loading
path_in_app_directory = nil
else
path_in_app_directory = File.join(RAILS_ROOT, 'app', 'cells',
template_path.to_s + '.' + extension.to_s)
end
with this:
path_in_app_directory = File.join(RAILS_ROOT, 'app', 'cells', template_path.to_s + '.' + extension.to_s)
Also, remove line 40 of the Cells plugin’s init.rb, which reads:
Engines.mix_code_from :cells
Then, remove line 32 of init_engine.rb:
Engines.current.version = Cells::VERSION
That is it! No more Engines dependency. You can go ahead and delete the Engines plugin folder from your project.
@Ted: What a load of nonsense. Simply having Engines in your plugin dir will not break anything since it doesn’t *do* anything unless you explicitly make use of its features.
@Mike: Thanks for the patch. I’ve applied it, but with a twist – if Engines is available, it is used, if not, it’s not required anymore.
[...] Removing the Engines dependency from Cells [...]
[...] Removing the Engines dependency from Cells [...]
March 22, 2008 at 3:15 pm
Gawd bless ya! Every time I’ve put “engines” into a project it’s wreaked complete havoc.