Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Forked from mattpolito/gist:52982
Created February 3, 2009 22:48
Show Gist options
  • Save trevorturk/57808 to your computer and use it in GitHub Desktop.
Save trevorturk/57808 to your computer and use it in GitHub Desktop.
# App Template
# By Matt Polito
# Link to local copy of edge rails
rake('rails:freeze:gems')
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
run "rm public/robots.txt"
run "rm -f public/javascripts/*"
# Download JQuery
inside('public/javascripts') do
run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.3.min.js > jquery.js"
run "curl -d 'version=1.6rc5&compression=jsmin&files%5B%5D=ui.core.js&files%5B%5D=ui.draggable.js&files%5B%5D=ui.droppable.js&files%5B%5D=ui.resizable.js&files%5B%5D=ui.selectable.js&files%5B%5D=ui.sortable.js&files%5B%5D=ui.accordion.js&files%5B%5D=ui.dialog.js&files%5B%5D=ui.slider.js&files%5B%5D=ui.tabs.js&files%5B%5D=ui.datepicker.js&files%5B%5D=ui.progressbar.js&files%5B%5D=effects.core.js&files%5B%5D=effects.blind.js&files%5B%5D=effects.bounce.js&files%5B%5D=effects.clip.js&files%5B%5D=effects.drop.js&files%5B%5D=effects.explode.js&files%5B%5D=effects.fold.js&files%5B%5D=effects.highlight.js&files%5B%5D=effects.pulsate.js&files%5B%5D=effects.scale.js&files%5B%5D=effects.shake.js&files%5B%5D=effects.slide.js&files%5B%5D=effects.transfer.js' http://ui.jquery.com/actions/download_builder.php -L > jqueryui.zip"
run "curl -L http://ui.jquery.com/applications/themeroller/download.php?href=/applications/themeroller/css/parseTheme.css.php?ctl=themeroller > theme.zip"
run "unzip theme.zip -d jquery-ui-theme"
run "rm theme.zip"
run "unzip jqueryui.zip"
run "rm jqueryui.zip"
run "rm -rf ui"
run "find . -name \"jquery-ui*.js\" | xargs -I xxx mv xxx jquery-ui.js"
end
# Set up git repository
git :init
git :add => '.'
# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"
# Set up .gitignore files
run "touch tmp/.gitignore log/.gitignore"
run %{find . -type d -empty | 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
# Set up session store initializer
initializer 'session_store.rb', <<-END
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
END
# Install all plugins
plugin 'open_id_authentication', :git => 'git://github.com/rails/open_id_authentication.git', :submodule => true
plugin 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git', :submodule => true
# Install all gems
gem 'authlogic', :version => '>= 1.4.0'
gem 'gravtastic', :version => '>= 2.0.0'
gem 'haml', :version => '>= 2.0.7'
gem 'ruby-openid', :lib => 'openid'
gem 'settingslogic'
# gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => 'http://gems.github.com'
rake('gems:install', :sudo => true)
rake('gems:unpack')
# Create DB
rake('db:create:all')
# Set up sessions, RSpec, user model, OpenID, etc, and run migrations
rake('db:sessions:create')
# generate("authenticated", "user session")
# generate("roles", "Role User")
# generate("rspec")
# rake('acts_as_taggable:db:create')
rake('open_id_authentication:db:create')
rake('db:migrate:reset')
# Initialize submodules
git :submodule => "init"
# Commit all work so far to the repository
git :add => '.'
git :commit => "-a -m 'Initial commit'"
# Success!
puts "SUCCESS!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment