Skip to content

Instantly share code, notes, and snippets.

@vita
Forked from karmi/minimal_rails_template.rb
Created November 30, 2009 16:16
Show Gist options
  • Save vita/245527 to your computer and use it in GitHub Desktop.
Save vita/245527 to your computer and use it in GitHub Desktop.
Kraxnet's rails template
# Delete/Move Rails default files
log 'moving', 'Rails default files'
run "mv README doc/README_FOR_RAILS"
run "rm public/index.html"
# Copy database.yml
log "copying", "database.yml"
run "cp config/database.yml config/database.example.yml"
# Create App config
log 'creating', 'appconfig.rb'
run "touch config/appconfig.rb config/appconfig.example.rb"
# Download Czech translations
log 'creating', 'config/locales/cz.rb'
run "curl -L http://github.com/svenfuchs/rails-i18n/raw/32d841a1d43729981dee9a0bc95216e9f35827f8/rails/locale/cz.rb > config/locales/cz.rb"
# Set up .gitignore files
log 'creating', '.gitignore files'
run "touch .gitignore"
file '.gitignore', <<-END
.DS_Store
log/*
db/schema.rb
config/appconfig.rb
config/database.yml
coverage
tmp/**/*
public/system/**/*
END
# Environment
file 'config/environment.rb', <<-FILE
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
config.i18n.load_path += Dir[File.join(RAILS_ROOT, 'config', 'locales', '**', '*.{rb,yml}')]
config.i18n.default_locale = :cz
end
# App settings
require File.join(File.dirname(__FILE__), "..","config","appconfig")
FILE
# Set up git repository
log 'initializing', 'Git repository'
git :init
git :add => '.'
git :commit => "-a -m 'Initial commit -- Blank Rails application'"
# Install Rubygems
log 'configure', 'rubygems'
gem 'factory_girl', :lib => 'factory_girl', :source => 'http://gemcutter.org'
gem 'shoulda', :lib => 'shoulda', :source => 'http://gemcutter.org'
gem 'i18n', :version => '0.2.0'
gem 'will_paginate', :source => 'http://gemcutter.org'
gem 'clearance', :source => 'http://gemcutter.org' if yes?("Want you use Clearance?")
rake "gems:install", :sudo => true
rake "gems:unpack"
git :add => '.'
git :commit => "-m 'Added gems'"
# Install plugins
plugin 'i18n_label', :git => 'git://github.com/iain/i18n_label.git'
plugin 'coverage_tasks', :git => 'git://github.com/vita/coverage_tasks.git'
git :add => '.'
git :commit => "-m 'Added plugins'"
log ' *** ALL DONE ***'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment