-
Notifications
You must be signed in to change notification settings - Fork 247
Fix config.assets.manifest Rake task and Railtie #136
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
Conversation
- fix Rake task - fix config.assets.compile = false case - add additional test cases related to config.assets.manifest option
Tests are failing pending next sprockets gem release, specifically this commit: sstephenson/sprockets@d52c9df |
…stephenson/sprockets#560) that manifest filename must be explicitly specified by user.
@@ -85,7 +85,7 @@ Defaults to `/assets`. Changes the directory to compile assets to. | |||
|
|||
**`config.assets.manifest`** | |||
|
|||
Defines the full path to be used for the asset precompiler's manifest file. Defaults to using the `config.assets.prefix` directory within the public folder. | |||
Defines the full path to be used for the asset precompiler's manifest file. Must include filename. Defaults to using the `config.assets.prefix` directory within the public folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "full path [..] for [..] file" pretty much covers "must include filename". I think the bigger issue here remains: it doesn't actually default to that at all... it defaults to a randomly-generated filename inside the config.assets.prefix
directory within the public folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I use the wording:
Defines the full path to be used for the asset precompiler's manifest file. Defaults to a randomly-generated filename in the
config.assets.prefix
directory within the public folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it's not up to me.. I do feel that better addresses any suggestion that the option can point to a directory.
@johnnyshields we will need to explicitly as @josh to backport that commit to 2.11.x release or we will not able to use in sprockets-rails 2.x. sprockets master is already sprockets 3. |
@rafaelfranca the issue in Sprockets is that when user specifies a manifest file in a directory that does not yet exist, Sprockets raises an error (rather than creating the directory). I've raised a PR for the backport here: sstephenson/sprockets#561 Sprocket-Rails could be released without this backport (I can change the test case) but it may cause some users to scratch their heads if they haven't already created their manifest dir. |
@rafaelfranca issue is resolved in Sprockets, @josh has pushed a new version, and tests are passing after pointing Sprockets-Rails gemspec to the new Sprockets version. |
New version is 2.12.1 and Rails applications are not able to use 2.12.x 😢 I can merge this one but people using sass-rails will still have to provide the full path with directories already existing. |
OK I undid the sprockets dependency bump. CI tests are passing because existing gemspec references sprockets ~> 2.8, which evaluates to 2.12.1 for Travis purposes. Green-light to merge, no change for SASS users. |
@rafaelfranca this PR is ready to merge. |
+1 @rafaelfranca, can this please be merged? I have a couple of projects that need this before I can upgrade to rails 4.1. Thanks |
+1 Same here. This is the main blocker that's preventing the projects that I have from adopting/upgrading to Rails 4.x |
Fix config.assets.manifest Rake task and Railtie
Fix config.assets.manifest Rake task and Railtie Conflicts: test/test_railtie.rb
@rafaelfranca thank you for merging. To anyone upgrading, as a friendly reminder you'll need to set |
Thank you @johnnyshields for creating the PR and @rafaelfranca for merging it. For those who are using |
FYI doc update for Rails Guides related to this is in rails/rails#16375 |
Currently,
config.assets.manifest
is not functioning as it should be. However, currently there no problem ifconfig.assets.manifest
is nil.assets:precompile
Rake task. TheSprockets::Manifest
object used in the Rake task is separate from the one created in the Railtie.config.assets.compile = false
case. It is necessary to initialize theSprockets::Manifest
object with both the path to the assets, and the manifest path as parameters.manifest_path
tomanifest_assets_path
for clarity, and revert its definition to what it was before PR Restoreconfig.assets.manifest
option #122Proper functionality of the
config.assets.manifest
also requires this PR: sstephenson/sprockets#560. (Again, there is no issue ifconfig.assets.manifest
is left nil)