Created
April 7, 2009 23:47
-
-
Save rrichards/91539 to your computer and use it in GitHub Desktop.
rails template for skeleton app, haml, sass, shoulda, factory_girl, jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
run %{find . -type d -empty | xargs -I xxx touch xxx/.gitignore} | |
file '.gitignore', <<-END | |
.DS_Store | |
coverage/* | |
log/*.log | |
db/*.db | |
db/*.sqlite3 | |
db/schema.rb | |
tmp/**/* | |
doc/api | |
doc/app | |
config/database.yml | |
coverage/* | |
public/stylesheets/*.css | |
END | |
# get jquery and plugins | |
run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.3.2.js > public/javascripts/jquery.js" | |
run "curl -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js" | |
# 960.gs | |
run "curl -L http://github.com/nathansmith/960-grid-system/tree/master/code/css/uncompressed/960.css > public/stylesheets/960.css" | |
run "curl -L http://github.com/nathansmith/960-grid-system/tree/master/code/css/uncompressed/reset.css > public/stylesheets/reset.css" | |
run "curl -L http://github.com/nathansmith/960-grid-system/tree/master/code/css/uncompressed/text.css > public/stylesheets/text.css" | |
# SASS | |
run "mkdir public/stylesheets/sass" | |
run "css2sass public/stylesheets/960.css public/stylesheets/sass/960.sass" | |
run "css2sass public/stylesheets/text.css public/stylesheets/sass/text60.sass" | |
run "css2sass public/stylesheets/reset.css public/stylesheets/sass/reset.sass" | |
run 'rm -rf public/stylesheets/*.css' | |
# application layout | |
file 'app/views/layouts/application.html.haml', <<-FILE | |
!!! | |
%html{ "xml:lang" => "en", :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" } | |
%head | |
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-type" } | |
%title | |
\#{app_name} | |
= stylesheet_link_tag 'screen', 'datePicker', :media => 'screen, projection' | |
= stylesheet_link_tag 'print', :media => 'print' | |
/ | |
[if IE]> | |
= stylesheet_link_tag 'ie', :media => 'all' | |
<![endif] | |
= javascript_include_tag 'jquery', 'jquery.form.js', 'date', 'jquery.datePicker.js', :cache => true | |
= yield(:head) | |
%script{ :type => "text/javascript" } | |
$(function() { | |
= yield(:jquery) | |
}); | |
%body | |
#navigation | |
#content | |
- if flash[:notice] | |
#flash | |
= flash[:notice] | |
= yield | |
FILE | |
# Install plugins as git submodules | |
plugin 'query_reviewer', :git => 'git://github.com/dsboulder/query_reviewer.git', :submodule => true | |
plugin 'asset_packager', :git => 'git://github.com/sbecker/asset_packager.git', :submodule => true | |
plugin 'shoulda', :git => 'git://github.com/thoughtbot/shoulda.git', :submodule => true | |
plugin 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git', :submodule => true | |
plugin 'jrails', :git => 'git://github.com/aaronchi/jrails.git', :submodule => true | |
plugin 'haml', :git => 'git://github.com/nex3/haml.git', :submodule => true | |
plugin 'acts-as-taggable-on', :git => 'git://github.com/mbleigh/acts-as-taggable-on.git', :submodule => true | |
plugin 'authlogic', :git => 'git://github.com/binarylogic/authlogic.git vendor/plugins/authlogic', :submodule => true | |
plugin 'authlogic_generator', :git => 'git://github.com/masone/authlogic_generator.git', :submodule => true | |
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git', :submodule => true | |
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git', :submodule => true | |
plugin 'thinking-sphinx', :git => 'git://github.com/freelancing-god/thinking-sphinx.git', :submodule => true | |
# Initialize submodules | |
git :submodule => "init" | |
# Setup HAML | |
run %{haml --rails .} | |
gem 'jscruggs-metric_fu', :lib => 'metric_fu', :source => 'http://gems.github.com' | |
rake('gems:install', :sudo => true) | |
rake('db:sessions:create') | |
generate :acts_as_taggable_on_migration | |
generate :authlogic | |
run 'capify .' | |
rake('db:migrate') | |
# Commit all work so far to the repository | |
git :add => '.' | |
git :commit => "-a -m 'Initial commit'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment