Skip to content

Instantly share code, notes, and snippets.

@krsmurata
Forked from semanticart/rails3-skeletor.rb
Created October 16, 2010 00:56
Show Gist options
  • Save krsmurata/629240 to your computer and use it in GitHub Desktop.
Save krsmurata/629240 to your computer and use it in GitHub Desktop.
# usage: rails new APP_NAME -m http://gist.github.com/629240.txt -TJ
# the -T drops test-unit and the -J drops prototype
gem "mysql2"
gem "haml"
gem "sass"
gem "compass"
gem "rspec-rails", "2.0.1"
gem "factory_girl"
gem "devise"
# compass setup - admittedly this is largely cargo culted from some heroku
# apps I've done and may not be 100% necessary. YMMV, feel free to comment
# and/or fork to correct :)
initializer 'compass.rb', <<-CODE
Compass.add_project_configuration(File.join(RAILS_ROOT, "config", "compass.config"))
Compass.configuration.environment = RAILS_ENV.to_sym
Compass.configure_sass_plugin!
CODE
file 'config/compass.config', <<-CODE
project_type = :rails
project_path = RAILS_ROOT if defined?(RAILS_ROOT)
# Set this to the root of your project when deployed:
http_path = "/"
images_dir = "public/images"
javascripts_dir = "public/javascripts"
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
http_images_path = "/images"
http_stylesheets_path = "/stylesheets"
http_javascripts_path = "/javascripts"
css_dir = "public/stylesheets"
sass_dir = "app/stylesheets"
CODE
run 'mkdir app/stylesheets'
# application layout
file 'app/views/layouts/application.html.haml', <<-CODE
!!! 5
%html{:lang => 'en'}
%head
%meta{:charset => 'UTF-8'}
%title Some Title Goes Here
= stylesheet_link_tag 'main', :media => 'screen'
= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js'
= javascript_include_tag 'application'
%body
=yield
CODE
# install gems and generate our test stuff
run "bundle install"
run "rails generate rspec:install"
# remove unnecessary files
run 'rm README'
run 'touch README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
run 'rm app/views/layouts/application.html.erb'
# git-ify
git :init
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