Browse files

Setup sample.env and Procfile for foreman

* Add method to setup foreman and copy files
* Add message reminding user to copy .env file
* Add Heroku instructions to sample.env file
  • Loading branch information...
1 parent 3bed52b commit 6b48ec6d29c888f4be93e22930d60363c5f352de Adarsh Pandit committed Nov 9, 2012
Showing with 22 additions and 0 deletions.
  1. +1 −0 Procfile
  2. +5 −0 lib/suspenders/app_builder.rb
  3. +2 −0 lib/suspenders/generators/app_generator.rb
  4. +14 −0 templates/sample.env
View
1 Procfile
@@ -0,0 +1 @@
+web: bundle exec thin start -p $PORT -e $RACK_ENV
View
5 lib/suspenders/app_builder.rb
@@ -174,6 +174,11 @@ def generate_clearance
generate 'clearance:install'
end
+ def setup_foreman
+ copy_file 'sample.env', 'sample.env'
+ copy_file 'Procfile', 'Procfile'
+ end
+
def setup_stylesheets
copy_file 'app/assets/stylesheets/application.css',
'app/assets/stylesheets/application.css.scss'
View
2 lib/suspenders/generators/app_generator.rb
@@ -130,6 +130,8 @@ def configure_app
build :add_email_validator
build :setup_default_rake_task
build :setup_clearance
+ say 'Adding sample Procfile. Copy sample.env to .env'
+ build :setup_foreman
end
def setup_clearance
View
14 templates/sample.env
@@ -0,0 +1,14 @@
+# Foreman reads environment variables from a .env file. For more info, see
+# http://blog.akash.im/per-project-environment-variables-with-forema
+
+# To use foreman:
+# - Copy this file to `.env` on your local machine
+# - Add `.env` to your `.gitignore` file
+# - On Heroku, do `heroku config:add RACK_ENV=(staging|production)
+
+
+# Needed for thin.
+RACK_ENV=development
+
+# Set as appropriate for environment.
+HOSTNAME=localhost:3000

0 comments on commit 6b48ec6

Please sign in to comment.