Skip to content

Instantly share code, notes, and snippets.

@nog
Created March 27, 2009 09:24
Show Gist options
  • Save nog/86616 to your computer and use it in GitHub Desktop.
Save nog/86616 to your computer and use it in GitHub Desktop.
nog rails application template
#ぼくが考えた最強のれいるずてんぷれーと!
# Copy database.yml
run "cp config/database.yml config/database.sample.yml"
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
#git
git :init
# Install gems
#gem 'rspec',
# :lib => false, :version => "1.2.2", :env => :test
#gem 'rspec-rails',
# :lib => false, :version => "1.2.2", :env => :test
gem 'amatsuda-i18n_generators',
:source => 'http://gems.github.com', :lib => false
gem 'mislav-will_paginate', :version => '~> 2.2.3',
:lib => 'will_paginate', :source => 'http://gems.github.com'
#rake "gems:unpack"
rake "gems:install", :sudo => true
# Add .gitignore
file '.gitignore', <<-END
log/*
tmp/**/*
config/database.yml
config/memcached.yml
db/*.sqlite3
db/*.sqlite3-journal
db/schema.rb
Thumbs.db
.DS_Store
*.swp
.rake_tasks
END
# Execute generator
generate :rspec
generate :i18n, "ja"
#create initializer
initializer 'will_paginate.rb', <<-CODE
WillPaginate::ViewHelpers.pagination_options.merge!({
:prev_label => '&laquo; 前へ',
:next_label => '次へ &raquo;'
})
CODE
#create welcome controller
#generate :rspec_controller, "welcome index"
generate :controller, "welcome index"
route "map.root :controller => 'welcome'"
# Commit git
git :add => "."
git :commit => "-a -m 'First commit.'"
rake "db:migrate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment