zweilove/css_splitter — pull request #35 by Umofomia (2014-05-06 02:52:17+00:00)
Title: Convert splitter engine to be a Sprockets bundle processor

Fixes #29.

As described in the comments in #29, this pull request converts the splitter to be a Sprockets bundle processor rather than a Sprockets engine in order to fix the issues surrounding the use of `require` directives in Sprockets. This is because CSS splitting needs to be performed on the final bundled asset rather than on individual assets that may be required as dependencies. This also ends up addressing the prohibition against using `require_tree .` and `require_self`, which no longer apply.

This change does end up changing the way split assets are specified. In particular, the redundant `.split2` extension is no longer necessary. This also opened the possibility of easily supporting multiple split files, so I added a `:split_count` option to the `split_stylesheet_link_tag` helper. The changes are noted in the updated README.

I also made sure to add tests make use of the compiled assets from Rails' asset pipeline to ensure the proper output.

@jhilden You mentioned you wanted to release a new major version with this change since this would break backward compatibility. I didn't know whether I should have changed the version number in this pull request whether you wanted to manage it after this gets merged in, so I didn't touch the version number for now.