Skip to content

Instantly share code, notes, and snippets.

@mrichman
Created March 26, 2009 21:05
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 mrichman/86336 to your computer and use it in GitHub Desktop.
Save mrichman/86336 to your computer and use it in GitHub Desktop.
# template.rb
gem 'activemerchant', :lib => 'active_merchant'
gem 'sqlite3-ruby', :lib => 'sqlite3'
gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
plugin 'exception_notifier', :git => 'git://github.com/rails/exception_notification.git'
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git'
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git'
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
plugin 'asset_packager', :git => 'http://synthesis.sbecker.net/pages/asset_packager'
plugin 'role_requirement', :git => 'git://github.com/timcharper/role_requirement.git'
plugin 'haml', :git => "git://github.com/nex3/haml.git"
rake('gems:install', :sudo => true) if yes?('Install gems on local system? (y/n)')
# Use database (active record) session store
rake('db:sessions:create')
initializer 'session_store.rb', <<-FILE
ActionController::Base.session = { :session_key => '_#{(1..6).map { |x| (65 + rand(26)).chr }.join}_session',
:secret => '#{(1..40).map { |x| (65 + rand(26)).chr }.join}' }
ActionController::Base.session_store = :active_record_store
FILE
# Generate roles for User
generate('roles', 'Role User')
# Generate restful-authentication user and session
generate('authenticated', 'user session')
# Run rspec generator
generate("rspec")
run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js > public/javascripts/jquery.js"
run "curl -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js"
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore}
file '.gitignore', <<-END
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
END
run 'cp config/database.yml config/database.yml.example'
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/robots.txt'
run 'rm public/images/rails.png'
# Install and configure capistrano
run 'sudo gem install capistrano' if yes?('Install Capistrano on your local system? (y/n)')
capify!
file 'Capfile', <<-FILE
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
FILE
# Set up git repository
git :init
git :add => '.'
## OUTPUT:
macpro:rails_apps mark$ rails test -m template.rb
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
create script/performance
create test/fixtures
create test/functional
create test/integration
create test/performance
create test/unit
create vendor
create vendor/plugins
create tmp/sessions
create tmp/sockets
create tmp/cache
create tmp/pids
create Rakefile
create README
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create config/database.yml
create config/routes.rb
create config/locales/en.yml
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_rails_defaults.rb
create config/initializers/session_store.rb
create config/environment.rb
create config/boot.rb
create config/environments/production.rb
create config/environments/development.rb
create config/environments/test.rb
create script/about
create script/console
create script/dbconsole
create script/destroy
create script/generate
create script/runner
create script/server
create script/plugin
create script/performance/benchmarker
create script/performance/profiler
create test/test_helper.rb
create test/performance/browsing_test.rb
create public/404.html
create public/422.html
create public/500.html
create public/index.html
create public/favicon.ico
create public/robots.txt
create public/images/rails.png
create public/javascripts/prototype.js
create public/javascripts/effects.js
create public/javascripts/dragdrop.js
create public/javascripts/controls.js
create public/javascripts/application.js
create doc/README_FOR_APP
create log/server.log
create log/production.log
create log/development.log
create log/test.log
applying template: template.rb
gem activemerchant
gem sqlite3-ruby
gem mislav-will_paginate
plugin exception_notifier
Unpacking objects: 100% (23/23), done.
From git://github.com/rails/exception_notification
* branch HEAD -> FETCH_HEAD
plugin rspec
From git://github.com/dchelimsky/rspec
* branch HEAD -> FETCH_HEAD
plugin rspec-rails
From git://github.com/dchelimsky/rspec-rails
* branch HEAD -> FETCH_HEAD
plugin paperclip
Unpacking objects: 100% (69/69), done.
From git://github.com/thoughtbot/paperclip
* branch HEAD -> FETCH_HEAD
plugin restful-authentication
From git://github.com/technoweenie/restful-authentication
* branch HEAD -> FETCH_HEAD
plugin asset_packager
plugin role_requirement
Unpacking objects: 100% (33/33), done.
From git://github.com/timcharper/role_requirement
* branch HEAD -> FETCH_HEAD
plugin haml
From git://github.com/nex3/haml
* branch HEAD -> FETCH_HEAD
Install gems on local system? (y/n)
y
rake gems:install
Password:
rake aborted!
uninitialized constant Inflector
(See full trace by running task with --trace)
rake db:sessions:create
rake aborted!
uninitialized constant Inflector
(See full trace by running task with --trace)
initializer session_store.rb
generating roles
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Inflector (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activemerchant-1.3.2/lib/active_merchant/billing/integrations.rb:13
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
... 16 levels...
from /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/generate:3
generating authenticated
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Inflector (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activemerchant-1.3.2/lib/active_merchant/billing/integrations.rb:13
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
... 16 levels...
from /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/generate:3
generating rspec
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Inflector (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/activemerchant-1.3.2/lib/active_merchant/billing/integrations.rb:13
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
... 16 levels...
from /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:1
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/generate:3
executing curl -L http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js > public/javascripts/jquery.js from /Users/mark/rails_apps/test
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 55774 100 55774 0 0 69946 0 --:--:-- --:--:-- --:--:-- 118k
executing curl -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js from /Users/mark/rails_apps/test
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 23074 100 23074 0 0 36971 0 --:--:-- --:--:-- --:--:-- 70133
executing touch tmp/.gitignore log/.gitignore vendor/.gitignore from /Users/mark/rails_apps/test
executing find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore from /Users/mark/rails_apps/test
file .gitignore
executing cp config/database.yml config/database.yml.example from /Users/mark/rails_apps/test
executing rm README from /Users/mark/rails_apps/test
executing rm public/index.html from /Users/mark/rails_apps/test
executing rm public/favicon.ico from /Users/mark/rails_apps/test
executing rm public/robots.txt from /Users/mark/rails_apps/test
executing rm public/images/rails.png from /Users/mark/rails_apps/test
Install Capistrano on your local system? (y/n)
y
executing sudo gem install capistrano from /Users/mark/rails_apps/test
capifying
file Capfile
running git init
running git add .
applied template.rb
### EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment