Skip to content
Browse files

[#95] Use Heroku-compliant asset pipeline settings

  • Loading branch information...
1 parent 7d8d89b commit c6f3a61c0031391f62fa899cb7d9a6b681743d41 @croaky croaky committed Aug 6, 2012
Showing with 8 additions and 0 deletions.
  1. +1 −0 README.md
  2. +6 −0 lib/suspenders/app_builder.rb
  3. +1 −0 lib/suspenders/generators/app_generator.rb
View
1 README.md
@@ -50,6 +50,7 @@ Suspenders also comes with:
* Rails' flashes set up and in application layout.
* A few nice time formats.
+* [Heroku-compliant asset pipeline settings](https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar/).
Heroku
------
View
6 lib/suspenders/app_builder.rb
@@ -27,6 +27,12 @@ def setup_staging_environment
run 'cp config/environments/production.rb config/environments/staging.rb'
end
+ def initialize_on_precompile
+ inject_into_file 'config/application.rb',
+ "\n config.assets.initialize_on_precompile = false",
+ :after => 'config.assets.enabled = true'
+ end
+
def create_partials_directory
empty_directory 'app/views/application'
end
View
1 lib/suspenders/generators/app_generator.rb
@@ -61,6 +61,7 @@ def setup_development_environment
def setup_staging_environment
say 'Setting up the staging environment'
build :setup_staging_environment
+ build :initialize_on_precompile
end
def create_suspenders_views

0 comments on commit c6f3a61

Please sign in to comment.
Something went wrong with that request. Please try again.