Skip to content

Instantly share code, notes, and snippets.

@jaakkos
Created October 8, 2010 12:43
Show Gist options
  • Save jaakkos/616723 to your computer and use it in GitHub Desktop.
Save jaakkos/616723 to your computer and use it in GitHub Desktop.
gem "haml", ">= 3.0.12"
gem "factory_girl"
gem "rspec-rails", ">= 2.0.0.beta.15", :group => :test
generators = <<-GENERATORS
config.generators do |g|
g.orm :active_record
g.template_engine :haml
g.test_framework :rspec, :fixture => false, :views => false
g.fixture_replacement :factory_girl
end
GENERATORS
application generators
get "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", "public/javascripts/jquery.js"
get "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "public/javascripts/jquery-ui.js"
get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js"
jquery = <<-JQUERY
module ActionView::Helpers::AssetTagHelper
remove_const :JAVASCRIPT_DEFAULT_SOURCES
JAVASCRIPT_DEFAULT_SOURCES = %w(jquery.js jquery-ui.js rails.js)
reset_javascript_include_default
end
JQUERY
initializer "jquery.rb", jquery
layout = <<-LAYOUT
!!!
%html
%head
%title #{app_name.humanize}
= stylesheet_link_tag :all
= javascript_include_tag :defaults
= csrf_meta_tag
%body
= yield
LAYOUT
remove_file "app/views/layouts/application.html.erb"
create_file "app/views/layouts/application.html.haml", layout
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 rspec:install
DOCS
log docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment