Skip to content

Commit

Permalink
If a manifest file was detected skip rake detect
Browse files Browse the repository at this point in the history
When a user is deploying with a manifest, we don't not need to load up their Rake to see if they have the `asset:precompile` task. Changing the order of the checks prevents users from seeing debugging information that is not needed and helps speed up apps by doing less work.
  • Loading branch information
schneems committed Dec 10, 2013
1 parent 07aa1b4 commit 55ff6dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Features:
Bugfixes:

* Windows warnings will now display before bundle install, this prevents an un-resolvable `Gemfile` from erroring which previously prevented the warning roll up from being shown. When this happened the developer did not see that we are clearing the `Gemfile.lock` from the git repository when bundled on a windows machine.

* Checks for `public/assets/manifest*.json` and `public/assets/manifest.yml` will now come before Rake task detection introduced in v85.

## v85 (12/05/2013)

Expand Down
9 changes: 5 additions & 4 deletions lib/language_pack/rails3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ def run_assets_precompile_rake_task
log("assets_precompile") do
setup_database_url_env

precompile = rake.task("assets:precompile")
return true unless precompile.is_defined?

topic("Preparing app for Rails asset pipeline")
if File.exists?("public/assets/manifest.yml")
puts "Detected manifest.yml, assuming assets were compiled locally"
return true
end

precompile = rake.task("assets:precompile")
return true unless precompile.is_defined?

topic("Preparing app for Rails asset pipeline")

ENV["RAILS_GROUPS"] ||= "assets"
ENV["RAILS_ENV"] ||= "production"

Expand Down
6 changes: 3 additions & 3 deletions lib/language_pack/rails4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ def run_assets_precompile_rake_task
log("assets_precompile") do
setup_database_url_env

precompile = rake.task("assets:precompile")
return true unless precompile.is_defined?

if Dir.glob('public/assets/manifest-*.json').any?
puts "Detected manifest file, assuming assets were compiled locally"
return true
end

precompile = rake.task("assets:precompile")
return true unless precompile.is_defined?

topic("Preparing app for Rails asset pipeline")
ENV["RAILS_GROUPS"] ||= "assets"
ENV["RAILS_ENV"] ||= "production"
Expand Down

0 comments on commit 55ff6dd

Please sign in to comment.