Skip to content

Instantly share code, notes, and snippets.

@saberma
Created September 12, 2009 08:50
Show Gist options
  • Save saberma/185762 to your computer and use it in GitHub Desktop.
Save saberma/185762 to your computer and use it in GitHub Desktop.
rails template
#rails . -d mysql -m http://gist.github.com/185762.txt
#http://m.onkey.org/2008/12/4/rails-templates
run "rm doc/README_FOR_APP"
run "rm public/index.html"
run "rm README"
run "rm public/favicon.ico"
# Set up git repository
git :init
# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"
# Set up .gitignore files
file '.gitignore', <<-END
#db
config/database.yml
db/schema.rb
#log
log/**
*.log
*.pid
#tmp
tmp/**
#vim swap file
**.swp
**.swo
**.swn
**.*~
#rcov
coverage/**
#selenium
vendor/plugins/selenium-on-rails/log/**
#doc
doc/api
doc/app
#bundle-fu
public/javascripts/cache
public/stylesheets/cache
#sitemap
public/sitemap*
#share by capistrano
public/photos/**
#swf_fu
public/swfs
#taobao
config/taobao.yml
END
#lib=false,we don't need rails to load test lib
gem 'rspec', :lib => false
gem 'rspec-rails', :lib => false
gem 'thoughtbot-factory_girl', :lib => false
gem 'binarylogic-authlogic', :lib => 'authlogic'
gem 'haml'
#for haml use :textile
gem "RedCloth"
gem 'mysql'
gem 'mislav-will_paginate', :lib => 'will_paginate'
gem 'sitemap_generator', :lib => false
#for haml generator
gem 'haml_scaffold', :lib => false
gem 'whenever', :lib => false
rake 'gems:install' if yes?('get all gems?')
generate 'rspec'
rake 'gems:install'
plugin 'bundle-fu', :git => 'git://github.com/timcharper/bundle-fu.git'
plugin 'jrails', :git => 'git://github.com/aaronchi/jrails.git'
plugin 'selenium-on-rails', :git => 'git://github.com/paytonrules/selenium-on-rails.git'
#open-taobao
if yes?('need taobao open api?')
plugin 'rest-client', :git => 'git://github.com/archiloque/rest-client.git'
plugin 'crack', :git => 'git://github.com/jnunemaker/crack.git'
plugin 'open-taobao', :git => 'git://github.com/wear/open-taobao.git'
end
p "please do:"
p "sudo cp /usr/local/ruby/lib/ruby/gems/1.8/gems/haml-*/bin /usr/bin"
run 'haml --rails .'
rake 'jrails:js:install'
rake 'jrails:js:scrub'
# Success!
puts "SUCCESS!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment