Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@TMorgan99
Created November 17, 2009 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TMorgan99/237223 to your computer and use it in GitHub Desktop.
Save TMorgan99/237223 to your computer and use it in GitHub Desktop.
## Create a hosted hobo app on heroku ...
## This 'rails template' replicates the 'hobo' command, and then
## prepares the app for the heroku server.
## It completes by pushing the app to heroku.
## Issues:
## I package up the hobo gems in my vendor/gems tree, so heroku gets them
## not using heroku '.gem' file
## But then, the path in 'Rakefile' for 'hobo/rails/tasks' is not found
## so I move those tasks into the app's 'lib/tasks' directory.
## I found it necessary to generate the taglibs via the rake task
## --
# hobo CLI command switches set to thier defaults
user_model = 'user'
create_db = false
invite_only = false
#-
invite_only = invite_only ? '--invite-only' : ''
# force hobo into the vendor/gems tree
gem :hobo
rake 'gems:unpack:dependencies'
FileUtils.touch 'public/stylesheets/application.css'
generate :hobo, '--add-routes', '--add-gem'
generate :hobo_rapid, '--import-tags', invite_only
if user_model
generate :hobo_user_model, user_model, invite_only
generate :hobo_user_controller, user_model, invite_only
end
generate :hobo_front_controller, 'front', '--delete-index', '--add-routes', invite_only
if create_db
rake 'db:create:all'
end
run 'yes "" |generate hobo_migration --generate'
rake 'db:migrate:reset'
rake 'hobo:generate_taglibs' # Run the DRYML generators to generate taglibs in app/views/taglibs/auto
FileUtils.cp Dir['hero-90/vendor/gems/hobo-*/tasks/*'], 'hero-90/lib/tasks/'
file 'Rakefile', %q{
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
#require 'hobo/tasks/rails'
}
git :init
file '.gitignore', %q{
db/*.sqlite3
log/*.log
}
git :add => '.'
git :commit => '-aq -m "Initial Commit"'
# now push the code up to heroku, migrate into production database and have a look!
run 'heroku create'
git :push => 'heroku master'
run 'heroku rake db:migrate:reset'
run 'heroku open'
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment