Skip to content

Honor sass.style and assets.css_compressor config settings #105

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2012
Merged

Honor sass.style and assets.css_compressor config settings #105

merged 1 commit into from
May 26, 2012

Conversation

dgm
Copy link
Contributor

@dgm dgm commented May 21, 2012

We should allow railtie and compressor to honor config settings for sass.style and assets.css_compressor with default values if not otherwise set. This allows assets.css_compressor = :yui to actually work!

The rails guide on the asset pipeline indicates that we should set config.assets.css_compressor = :yui to use the yui compressor, but it doesn't actually work. The sass-rails gem currently hijacks the config setting without regard to previous settings.

Setting ||= :compressed is pointless if the style was initialized to :expanded at the beginning of the rail ties file. So it had to be moved to the else clause of the setup_compression initializer.

Added an initializer to CssCompressor to allow for any compression style to be passed in, and then passing in from the railtie. It might be good to do the same for the other options in the compressor. The initialize method is already heading in this direction. This makes it easier to configure, and easier to test.

Added another test fixture app, with different config settings set in different environments. Calling runcmd with different environments then allows for different config paths to be run.

…le and assets.css_compressor with default values if not otherwise set. This allows assets.css_compressor = :yui to actually work!

Setting ||= :compressed is pointless if the style was initialized to :expanded at the beginning of the rail ties file.  So it had to be moved to the else clause of the setup_compression initializer.

Added an initializer to CssCompressor to allow for any compression style to be passed in, and then passing in from the railtie.  It might be good to do the same for the other options in the compressor.  The initialize method is already heading in this direction.

Added another test fixture app, with different config settings set in deferent environments.  Calling runcmd with different environments then allows for different config paths to be run.
drogus added a commit that referenced this pull request May 26, 2012
Honor sass.style and assets.css_compressor config settings
@drogus drogus merged commit bdfeb7b into rails:3-2-stable May 26, 2012
@dgm
Copy link
Contributor Author

dgm commented Jul 5, 2012

I'm curious about whether this needs to be applied to the master branch, I haven't tried it yet, but I wouldn't want the changes to regress in rails 4.0

@drogus
Copy link
Member

drogus commented Jul 11, 2012

@dgm yes, it should be applied to master branch. Frankly I haven't noticed that the fix is for 3-2-stable, the general rule is: first fix in master, then backport to stable branches if needed. I will port it to master, thanks for noticing that!

@dgm
Copy link
Contributor Author

dgm commented Jul 12, 2012

Heh, well, I'm not using edge rails, so I wanted to fix stable. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants