Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Turn into rails engine, made it compatible with rails 3.1.1.rc1 #17

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

gucki commented Sep 28, 2011

Changed from railtie to engine:

  • compilation takes some seconds longer
  • runtime performance is the same
  • makes the whole code a lot easier and much more slim

Removed dependency on digestion:

  • seems rather complex for the little thing it does and incompatible with rails 3.1.1.rc1
  • added minor monkey patch directly here (see sprockets_monkey_patch.rb)
  • sprockets issue should be fixed upstream (I voted +1 here: rails/rails#2294)

Hope you like it :)

made it work with rails 3.1.1.rc1. changed from railtie to engine. re…
…moved dependecy of digestion, added much less invasive monkey patch.
Owner

spohlenz commented Oct 2, 2011

To keep you updated, I'm not ignoring this but I need some more time to review each of the issues.

In particular I want to remove the digestion dependency as Rails 3.1.1 solves this in a more straight-forward way, and I'll take another look at the compilation performance.

Owner

spohlenz commented Oct 10, 2011

I've removed the dependency on digestion, but have added in a replacement assets:precompile rake task to fix issues with Rails 3.1.0. Rails 3.1.1 solves this differently by compiling the assets with and without digests.

I tested the compilation with all of the assets in the pipeline and saw a doubling in compile time. There's also an issue in that the files are compressed twice, so I don't think its worth it to add them to the pipeline paths.

@spohlenz spohlenz closed this Oct 10, 2011

gucki commented Oct 14, 2011

Ok. I tested your master version and it works fine for me. A new gem release would be great :-)

Owner

spohlenz commented Oct 14, 2011

Version 3.4.6 incorporates all of those changes.

kuraga commented May 24, 2012

What is the reason of changing Railtie to Engine?

What is sprockets_monkeypatch for? Is it actual for Rails 3.2?

Owner

spohlenz commented May 24, 2012

@kuraga An Engine is a type of Railtie that adds a lot of common functionality automatically, in particular adding load paths for app/{controllers,models,views,etc}.

The sprockets_monkeypatch was necessary for Rails 3.0.0. I have since removed compatibility with that version of Rails though.

kuraga commented May 24, 2012

@spohlenz I know but what kind of this functionality was needed here?

Owner

spohlenz commented May 24, 2012

@kuraga The main reason is to give us a standard place to put asset files (app/assets and vendor/assets) without having to set the asset paths manually (see https://github.com/spohlenz/tinymce-rails/blob/b43e220cb8dbd13d6346ec2e4b0c5790dbab7536/lib/tinymce/railtie.rb#L14-15 for what was previously required).

It could be argued that using an engine over a railtie is overkill, and I would mostly agree. However there is a clear reduction in code with the engine version, meaning less possible changes required for future rails versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment