Skip to content

Instantly share code, notes, and snippets.

@visnup
Forked from nmerouze/app.rb
Created August 6, 2010 19:13
Show Gist options
  • Save visnup/511816 to your computer and use it in GitHub Desktop.
Save visnup/511816 to your computer and use it in GitHub Desktop.
rails3 template + haml, mongoid, rspec2
gem "bson_ext"
gem "haml"
gem "mongoid", ">= 2.0.0.beta.16"
gem "mongoid_rails_migrations"
gem "rails3-generators"
gem "database_cleaner", :group => :test
gem "rspec-rails", ">= 2.0.0.beta.17", :group => :test
generators = <<-GENERATORS
config.generators do |g|
g.orm :mongoid
g.template_engine :haml
g.test_framework :rspec, :fixture => false
end
GENERATORS
application generators
get "http://code.jquery.com/jquery.js", "public/javascripts/jquery.js"
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
layout = <<-LAYOUT
!!!
%html
%head
%title #{app_name.humanize}
= csrf_meta_tag
= stylesheet_link_tag :application
= javascript_include_tag :defaults
%body
= yield
LAYOUT
remove_file "app/views/layouts/application.html.erb"
create_file "app/views/layouts/application.html.haml", layout
remove_file "README"
remove_file "doc/README_FOR_APP"
remove_file "public/index.html"
remove_file "public/images/rails.png"
create_file "log/.gitkeep"
create_file "tmp/.gitkeep"
git :init
git :add => "."
docs = <<-DOCS
Run the following commands to complete the setup of #{app_name.humanize}:
% cd #{app_name}
% gem install bundler
% bundle install
% bundle lock
% script/rails generate mongoid:config
% script/rails generate rspec:install
DOCS
log docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment