-
-
Save ericluo/1007904 to your computer and use it in GitHub Desktop.
Rails 3, RSpec, Factory_Girl, HAML, SASS, Devise, JQuery, Backbone.js, jammit
This file contains hidden or 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
| ## Rails App Template | |
| ## Updated for Rails 3.0.1 | |
| ## Created on 10/23/10 | |
| ## Updated on 10/23/10 | |
| ## Run using $ rails new [appname] -JT -m tpl-cukeapp.rb | |
| ## Gems | |
| # Warden and Devise for security | |
| gem 'warden', '0.10.7' | |
| gem 'devise', '1.1.3' | |
| # Extra Plugins | |
| gem 'formtastic', '~> 1.1.0' | |
| gem 'escape_utils' | |
| # HAML and SASS for Templating | |
| gem 'haml' | |
| gem 'haml-rails' | |
| # Cucumber and Friends | |
| gem "rspec-rails", ">= 2.0.1", :group => [:test, :cucumber] | |
| gem "cucumber-rails", ">= 0.3.2", :group => [:test, :cucumber] | |
| gem "capybara", :group => [:test, :cucumber] | |
| gem "database_cleaner", :group => [:test, :cucumber] | |
| gem "factory_girl_rails", :group => [:test, :cucumber] | |
| gem "launchy", ">= 0.3.7", :group => [:test, :cucumber] | |
| gem "spork", ">= 0.8.4", :group => [:test, :cucumber] | |
| ## Generators | |
| generators = <<-GENERATORS | |
| config.i18n.default_locale = :de | |
| # Generator Settings | |
| config.generators do |g| | |
| g.template_engine :haml | |
| g.test_framework :rspec | |
| end | |
| # Global Sass Option | |
| Sass::Plugin.options[:template_location] = { 'app/stylesheets' => 'public/stylesheets' } | |
| GENERATORS | |
| gsub_file 'config/application.rb', 'config.i18n.default_locale = :de', generators | |
| # Clear the Javascripts | |
| run "rm public/javascripts/*.js" | |
| # Latest jQuery UJS | |
| get "http://github.com/rails/jquery-ujs/raw/master/src/rails.js", "public/javascripts/rails.js" | |
| # Replace the blank one with jQuery served via Google CDN | |
| gsub_file 'config/application.rb', 'config.action_view.javascript_expansions[:defaults] = %w()', 'config.action_view.javascript_expansions[:defaults] = %w(http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js rails.js)' | |
| # Run all the generators | |
| generate "rspec:install" | |
| generate "cucumber:install --capybara --rspec --spork" | |
| generate "formtastic:install" | |
| generate "devise:install" | |
| generate "devise User" | |
| ## Files | |
| run "rm public/index.html" | |
| create_file "public/javascripts/application.js" | |
| ## Layout | |
| 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 | |
| ## Git | |
| gitignore = <<-END | |
| .bundle | |
| .DS_Store | |
| db/*.sqlite3 | |
| log/*.log | |
| tmp/**/* | |
| public/stylesheets/* | |
| END | |
| remove_file ".gitignore" | |
| create_file ".gitignore", gitignore | |
| run "bundle install" | |
| git :init | |
| git :add => "." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment