├── .gitignore
├── bootstrap.rb
├── resources
├── .gitignore
├── cucumber.yml
├── layout.html.erb
├── layout.haml
├── reset.css
└── reset.scss
├── cleanup.rb
├── capistrano.rb
├── full.rb
├── rvm.rb
├── jquery.rb
├── gems.rb
├── database.rb
├── layout.rb
├── git.rb
├── cucumber.rb
├── rspec.rb
└── README.markdown
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/*
2 |
--------------------------------------------------------------------------------
/bootstrap.rb:
--------------------------------------------------------------------------------
1 | if yes?("Create database? (Needs all gems to be installed first)", :yellow)
2 | run 'bundle install'
3 | rake "db:create"
4 | end
--------------------------------------------------------------------------------
/resources/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 | .bundle
3 | .idea/*
4 | log/*
5 | tmp/*
6 | db/schema.rb
7 | db/*.sqlite3
8 | public/system
9 | coverage/*
10 | rerun.txt
11 | !.gitkeep
--------------------------------------------------------------------------------
/cleanup.rb:
--------------------------------------------------------------------------------
1 | remove_file "README"
2 | remove_file "doc/"
3 | remove_file "public/index.html"
4 | remove_file "public/images/rails.png"
5 |
6 | # cleanup gemfile, by removing all commented lines
7 | gsub_file "Gemfile", /#.*\n/, "\n"
8 | gsub_file "Gemfile", /\n+/, "\n"
9 |
10 | application do
11 | (" " * 2) + "config.generators do |generator|\n" +
12 | (" " * 4) + "end\n"
13 | end
--------------------------------------------------------------------------------
/resources/cucumber.yml:
--------------------------------------------------------------------------------
1 | <%
2 | rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3 | rerun_opts = rerun.to_s.strip.empty? ? "--format pretty" : "--format pretty #{rerun}"
4 | std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
5 | %>
6 | default: <%= std_opts %>
7 | wip: --tags @wip:3 --wip features
8 | rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
9 |
--------------------------------------------------------------------------------
/capistrano.rb:
--------------------------------------------------------------------------------
1 | if yes?("Setup Capistrano?", :yellow)
2 | gem "capistrano", :group => :development
3 | gem "capistrano-ext", :group => :development
4 |
5 | run 'gem install capistrano --no-rdoc --no-ri' unless Gem.available?("capistrano")
6 | run 'gem install capistrano-ext --no-rdoc --no-ri' unless Gem.available?("capistrano-ext")
7 |
8 | capify!
9 |
10 | # TODO specific configuration
11 | end
--------------------------------------------------------------------------------
/full.rb:
--------------------------------------------------------------------------------
1 | @template_path = File.dirname(__FILE__)
2 |
3 | apply "#{@template_path}/cleanup.rb"
4 | apply "#{@template_path}/rvm.rb"
5 | apply "#{@template_path}/database.rb"
6 | apply "#{@template_path}/cucumber.rb"
7 | apply "#{@template_path}/rspec.rb"
8 | apply "#{@template_path}/jquery.rb"
9 | apply "#{@template_path}/gems.rb"
10 | apply "#{@template_path}/layout.rb"
11 | apply "#{@template_path}/bootstrap.rb"
12 | apply "#{@template_path}/capistrano.rb"
13 | apply "#{@template_path}/git.rb"
14 |
15 | # TODO: resque
16 | # TODO: capistrano recipes
--------------------------------------------------------------------------------
/resources/layout.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | <%= csrf_meta_tag %>
23 |
24 |
25 |
26 |
27 |
28 |
29 | <%= yield %>
30 |
31 |
--------------------------------------------------------------------------------
/rvm.rb:
--------------------------------------------------------------------------------
1 | # This depends on the RVM gem...
2 | #
3 | # gem install rvm
4 | #
5 | # Note that you do not have to install RVM itself via the gem,
6 | # the gem just needs to be present so it can be used here.
7 | #
8 | # Note also that you MUST be using 1.9.2 already on the command
9 | # line when generating your Rails app...
10 | #
11 | # rvm use 1.9.2
12 |
13 | # TODO: check prerequisites
14 | unless Gem.available?("rspec", ">= 2.0.0")
15 | run "gem install rvm --no-rdoc --no-ri"
16 |
17 | Gem.refresh
18 | Gem.activate("rvm")
19 | end
20 |
21 | require 'rvm'
22 |
23 | create_file ".rvmrc" do
24 | "rvm 1.9.2@#{app_name}"
25 | end
26 |
27 | run "rvm rvmrc trust"
28 | run "rvm use 1.9.2@#{app_name} --create"
29 | run "rvm 1.9.2@#{app_name}"
30 | run "rvm gemset load #{app_name}"
31 |
32 | RVM.gemset_use! app_name
33 |
34 | # Now install the required gems in the new gemset
35 | unless Gem.available?("rails")
36 | run 'gem install rails --no-rdoc --no-ri'
37 | else
38 | say("Found rails, skipping installation", :cyan)
39 | end
40 |
--------------------------------------------------------------------------------
/resources/layout.haml:
--------------------------------------------------------------------------------
1 | !!! Strict
2 | %html{:lang => "en", "xml:lang" => "en", :xmlns => "http://www.w3.org/1999/xhtml", "xmlns:fb" => "http://www.facebook.com/2008/fbml", "xmlns:og" => "http://opengraphprotocol.org/schema/"}
3 | %head
4 | %title
5 | Application
6 | %meta{:content => "", :name => "description"}
7 | %meta{:content => "", :name => "keywords"}
8 |
9 | / Meta
10 | %meta{:content => "text/html; charset=utf-8", "http-equiv" => "content-type"}
11 | %meta{:content => "noodp", :name => "robots"}
12 |
13 | / Microsoft smarties
14 | %meta{:content => "no", "http-equiv" => "ImageResize"}
15 | %meta{:content => "no", "http-equiv" => "ImageToolbar"}
16 | %meta{:content => "true", :name => "MSSmartTagsPreventParsing"}
17 |
18 | / Icon
19 | %link{:href => "/favicon.ico", :rel => "icon", :type => "image/vnd.microsoft.icon"}
20 | %link{:href => "/favicon.ico", :rel => "shortcut icon"}
21 |
22 | = csrf_meta_tag
23 |
24 | / insert javascript here
25 | / insert stylesheet here
26 |
27 | %body
28 | = yield
--------------------------------------------------------------------------------
/resources/reset.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
3 | margin: 0;
4 | padding: 0;
5 | border: 0;
6 | outline: 0;
7 | font-weight: inherit;
8 | font-style: inherit;
9 | font-size: 100%;
10 | font-family: inherit;
11 | vertical-align: baseline;
12 | background: transparent;
13 | }
14 |
15 | :focus {
16 | outline: 0;
17 | }
18 |
19 | body {
20 | line-height: 1;
21 | color: #000000;
22 | background: #ffffff;
23 | }
24 |
25 | ol, ul {
26 | list-style: none;
27 | }
28 |
29 | table {
30 | border-collapse: collapse;
31 | border-spacing: 0;
32 | }
33 |
34 | caption, th, td {
35 | text-align: left;
36 | font-weight: normal;
37 | }
38 |
39 | blockquote:before, blockquote:after, q:before, q:after {
40 | content: "";
41 | }
42 |
43 | blockquote, q {
44 | quotes: "" "";
45 | }
--------------------------------------------------------------------------------
/jquery.rb:
--------------------------------------------------------------------------------
1 | inside "public/javascripts" do
2 | remove_file 'controls.js'
3 | remove_file 'dragdrop.js'
4 | remove_file 'effects.js'
5 | remove_file 'prototype.js'
6 | remove_file 'rails.js'
7 |
8 | get "https://github.com/rails/jquery-ujs/raw/master/src/rails.js", "rails.js"
9 | get "http://code.jquery.com/jquery-1.5.1.min.js", "jquery/jquery.min.js"
10 | get "http://plugins.jquery.com/files/jquery.metadata.2.1.zip", "jquery/jquery.metadata.zip"
11 |
12 | inside "jquery" do
13 | run "unzip jquery.metadata.zip -d jquery-metadata"
14 |
15 | create_file "jquery.metadata.js" do
16 | File.binread("jquery-metadata/jquery.metadata.2.1/jquery.metadata.js")
17 | end
18 |
19 | remove_file 'jquery.metadata.zip'
20 | remove_file 'jquery-metadata'
21 | end
22 | end
23 |
24 | application do
25 | "\n config.action_view.javascript_expansions[:defaults] = %w(jquery/jquery.min jquery/jquery.metadata rails)\n"
26 | end
27 |
28 | gsub_file "config/application.rb", /# JavaScript.*\n/, ""
29 | gsub_file "config/application.rb", /# config\.action_view\.javascript.*\n/, ""
30 |
31 |
--------------------------------------------------------------------------------
/resources/reset.scss:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp,
3 | small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
4 | margin: 0;
5 | padding: 0;
6 | border: 0;
7 | outline: 0;
8 | font-weight: inherit;
9 | font-style: inherit;
10 | font-size: 100%;
11 | font-family: inherit;
12 | vertical-align: baseline;
13 | background: transparent;
14 | }
15 |
16 | :focus {
17 | outline: 0;
18 | }
19 |
20 | body {
21 | line-height: 1;
22 | color: #000000;
23 | background: #ffffff;
24 | }
25 |
26 | ol, ul {
27 | list-style: none;
28 | }
29 |
30 | table {
31 | border-collapse: collapse;
32 | border-spacing: 0;
33 | }
34 |
35 | caption, th, td {
36 | text-align: left;
37 | font-weight: normal;
38 | }
39 |
40 | blockquote:before, blockquote:after, q:before, q:after {
41 | content: "";
42 | }
43 |
44 | blockquote, q {
45 | quotes: "" "";
46 | }
47 |
--------------------------------------------------------------------------------
/gems.rb:
--------------------------------------------------------------------------------
1 | gem 'rails3-generators'
2 |
3 | if yes?("Install jammit?", :yellow)
4 | gem 'jammit'
5 |
6 | create_file "config/assets.yml" do
7 | "package_assets: on\n" +
8 | "embed_images: off\n\n" +
9 | "javascripts:\n" +
10 | " application:\n" +
11 | " - public/javascripts/jquery/jquery.min.js\n" +
12 | " - public/javascripts/jquery/jquery.metadata.js\n" +
13 | " - public/javascripts/rails.js\n" +
14 | " - public/javascripts/application.js\n\n" +
15 | "stylesheets:\n" +
16 | " application:\n" +
17 | " - public/stylesheets/reset.css\n"
18 | end
19 |
20 | @use_jammit = true
21 | end
22 |
23 | if yes?("Install haml?", :yellow)
24 | gem 'haml'
25 | gem 'haml-rails'
26 |
27 | inject_into_file "config/application.rb", :after => "config.generators do |generator|\n" do
28 | (" " * 6) + "generator.template_engine :haml\n"
29 | end
30 |
31 | create_file "config/initializers/haml.rb" do
32 | <<-HAML
33 | Haml::Template.options[:attr_wrapper] = '\"'
34 | Haml::Template.options[:format] = :xhtml
35 | Sass::Plugin.options[:style] = :expanded
36 | HAML
37 | end
38 |
39 | @use_haml = true
40 | end
--------------------------------------------------------------------------------
/database.rb:
--------------------------------------------------------------------------------
1 | create_file "config/database.yml", :force => true do
2 | "setup: &setup
3 | adapter: #{options[:database]}
4 | encoding: utf8
5 | host: localhost
6 | pool: 5
7 |
8 | development:
9 | <<: *setup
10 | database: #{options[:database] =~ /sqlite3/ ? "db/development.sqlite3" : "#{app_name}_development"}
11 |
12 | test:
13 | <<: *setup
14 | database: #{options[:database] =~ /sqlite3/ ? "db/test.sqlite3" : "#{app_name}_test"}
15 |
16 | staging:
17 | <<: *setup
18 | database: #{options[:database] =~ /sqlite3/ ? "db/staging.sqlite3" : "#{app_name}_staging"}
19 |
20 | production:
21 | <<: *setup
22 | database: #{options[:database] =~ /sqlite3/ ? "db/production.sqlite3" : "#{app_name}_production"}
23 |
24 | cucumber:
25 | <<: *test"
26 | end
27 |
28 | unless Gem.available?(gem_for_database)
29 | run "gem install #{gem_for_database} --no-rdoc --no-ri"
30 | else
31 | say("Found #{gem_for_database}, skipping installation", :cyan)
32 | end
33 |
34 | if options[:database] =~ /postgresql/
35 | if yes?('Install silent-postgres gem?', :yellow)
36 | gem 'silent-postgres', :group => :delevelopment
37 | end
38 | end
39 |
40 | inject_into_file "config/application.rb", :after => "config.generators do |generator|\n" do
41 | (" " * 6) + "generator.orm :active_record\n"
42 | end
43 |
44 | # TODO: mongoid support
45 | # TODO: DataMapper support
--------------------------------------------------------------------------------
/layout.rb:
--------------------------------------------------------------------------------
1 | if @use_haml
2 | get "#{File.dirname(__FILE__)}/resources/reset.scss", "public/stylesheets/sass/reset.scss"
3 |
4 | append_file ".gitignore" do
5 | "public/stylesheets/*.css"
6 | end
7 |
8 | else
9 | get "#{File.dirname(__FILE__)}/resources/reset.css", "public/stylesheets/reset.css"
10 | end
11 |
12 | inside "app/views/layouts" do
13 | remove_file "application.html.erb"
14 |
15 | if @use_haml
16 | get "#{File.dirname(__FILE__)}/resources/layout.haml", "application.haml"
17 |
18 | gsub_file "application.haml", /\/ insert javascript here\n/, "= include_javascripts :application\n" if @use_jammit.present?
19 | gsub_file "application.haml", /\/ insert javascript here\n/, "= javascript_include_tag :defaults\n" if @use_jammit.nil?
20 |
21 | gsub_file "application.haml", /\/ insert stylesheet here\n/, "= include_stylesheets :application\n" if @use_jammit.present?
22 | gsub_file "application.haml", /\/ insert stylesheet here\n/, "= stylesheet_link_tag 'reset'\n" if @use_jammit.nil?
23 | else
24 | get "#{File.dirname(__FILE__)}/resources/layout.html.erb", "application.html.erb"
25 |
26 | gsub_file "application.html.erb", /\n/, "<%= include_javascripts :application %>\n" if @use_jammit.present?
27 | gsub_file "application.html.erb", /\n/, "<%= javascript_include_tag :defaults %>\n" if @use_jammit.nil?
28 |
29 | gsub_file "application.html.erb", /\n/, "<%= include_stylesheets :application %>\n" if @use_jammit.present?
30 | gsub_file "application.html.erb", /\n/, "<%= stylesheet_include_tag 'reset' %>\n" if @use_jammit.nil?
31 | end
32 | end
33 |
34 |
--------------------------------------------------------------------------------
/git.rb:
--------------------------------------------------------------------------------
1 | if yes?("Use Git?", :yellow)
2 |
3 | get "#{File.dirname(__FILE__)}/resources/.gitignore", ".gitignore", :force => true
4 |
5 | git :init
6 | git :add => "."
7 | git :commit => "-a -m '- initial commit'"
8 |
9 | if yes?("Initialize remote repository?", :yellow)
10 |
11 | set_repository = lambda { |repo| git :remote => "add origin #{repo}" unless repo.blank? }
12 | other_repository = lambda { ask("Enter Git repository URI:", :yellow) }
13 | repository_list = File.expand_path("~/.template-bucket/repositories")
14 |
15 | if File.exists?(repository_list)
16 |
17 | options = File.readlines(repository_list)
18 |
19 | say("Choose repository location:", :yellow)
20 |
21 | options.each_with_index do |repo, index|
22 | say("\t[#{index + 1}] #{repo.gsub(//, app_name)}")
23 | end
24 |
25 | say("\t[#{options.length + 1}] other repository")
26 |
27 | question = lambda { ask("Enter number:", :yellow) }
28 | repository = question.call
29 |
30 | while !(1..(options.length + 1)).include?(repository.to_i) do
31 | say("Incorrect option", :red)
32 | repository = question.call
33 | end
34 |
35 | if repository_url = options[repository.to_i]
36 | set_repository.call(repository_url.gsub(//, app_name))
37 | else
38 | set_repository.call(other_repository.call)
39 | end
40 |
41 | else
42 | say("~/template-bucket/repositories was not found, skipping pre-defined list of repositories", :magenta)
43 | say("You can configure your selection of repositories to ~/template-bucket/repositores to be used in this step", :magenta)
44 | say("The format is one repository URL per line, where the placeholder will be substituted with application name", :magenta)
45 |
46 | set_repository.call(other_repository.call)
47 | end
48 |
49 | end
50 | end
--------------------------------------------------------------------------------
/cucumber.rb:
--------------------------------------------------------------------------------
1 | if yes?("Use Cucumber behavior testing?", :yellow)
2 |
3 | gem 'database_cleaner', :group => :test
4 | gem 'cucumber', :group => :test
5 | gem 'cucumber-rails', :group => :test
6 | gem 'launchy', :group => :test
7 |
8 | if yes?("Use Capybara instead of Webrat?", :yellow)
9 | gem 'capybara', :group => :test
10 |
11 | @use_capybara = true
12 | else
13 | gem 'webrat', :group => :test
14 | end
15 |
16 | unless Gem.available?("cucumber-rails")
17 | run 'gem install cucumber --no-rdoc --no-ri'
18 | run 'gem install cucumber-rails --no-rdoc --no-ri'
19 | else
20 | say("Found cucumber, skipping installation", :cyan)
21 | say("Found cucumber-rails, skipping installation", :cyan)
22 | end
23 |
24 | unless Gem.available?("database_cleaner")
25 | run 'gem install database_cleaner --no-rdoc --no-ri'
26 | else
27 | say("Found database_cleaner, skipping installation", :cyan)
28 | end
29 |
30 | unless Gem.available?("launchy")
31 | run 'gem install launchy --no-rdoc --no-ri'
32 | else
33 | say("Found launchy gem, skipping installation", :cyan)
34 | end
35 |
36 | if @use_capybara
37 | unless Gem.available?("capybara")
38 | run 'gem install capybara --no-rdoc --no-ri'
39 | else
40 | say("Found capybara gem, skipping installation", :cyan)
41 | end
42 | else
43 | unless Gem.available?("webrat")
44 | run 'gem install webrat --no-rdoc --no-ri'
45 | else
46 | say("Found webrat gem, skipping installation", :cyan)
47 | end
48 | end
49 |
50 | arguments = [].tap do |arguments|
51 | arguments << "--webrat" if @use_capybara.nil?
52 | arguments << "--capybara" if @use_capybara.present?
53 | arguments << "--rspec" if yes?("Use with rspec?", :yellow)
54 | end
55 |
56 | generate "cucumber:install #{arguments.join(" ")}"
57 |
58 | get "#{File.dirname(__FILE__)}/resources/cucumber.yml", "config/cucumber.yml", :force => true
59 |
60 | end
--------------------------------------------------------------------------------
/rspec.rb:
--------------------------------------------------------------------------------
1 | if yes?("Install rspec and rspec-rails?", :yellow)
2 |
3 | @use_rspec = true
4 |
5 | remove_file "test/"
6 |
7 | inject_into_file "config/application.rb", :after => "config.generators do |generator|\n" do
8 | (" " * 6) + "generator.test_framework :rspec, :views => false\n"
9 | end
10 |
11 | gem 'rspec', '>= 2.0.0', :group => :test
12 | gem 'rspec-rails', '>= 2.0.0', :group => :test
13 | gem 'database_cleaner', :group => :test
14 |
15 | unless Gem.available?("rspec", ">= 2.0.0")
16 | run "gem install rspec -v '>= 2.0.0' --no-rdoc --no-ri"
17 | run "gem install rspec-rails -v '>= 2.0.0' --no-rdoc --no-ri"
18 | else
19 | say("Found rspec gem, skipping installation", :cyan)
20 | say("Found rspec-rails gems, skipping installation", :cyan)
21 | end
22 |
23 | unless Gem.available?("database_cleaner")
24 | run 'gem install database_cleaner --no-rdoc --no-ri'
25 | else
26 | say("Found database_cleaner, skipping installation", :cyan)
27 | end
28 |
29 | generate "rspec:install"
30 |
31 | if yes?("Install mocha?", :yellow)
32 | gem 'mocha', :group => :test
33 |
34 | append_file "spec/spec_helper.rb" do
35 | "Mocha::Configuration.warn_when(:stubbing_non_existent_method)\n" +
36 | "Mocha::Configuration.warn_when(:stubbing_non_public_method)"
37 | end
38 |
39 | gsub_file "spec/spec_helper.rb", /config\.mock_with :rspec/, "config.mock_with :mocha"
40 | end
41 |
42 | append_file "spec/spec_helper.rb" do
43 | "\nDatabaseCleaner.strategy = :truncation"
44 | end
45 |
46 | end
47 |
48 | if yes?("Install factory_girl?", :yellow)
49 | gem 'factory_girl_rails', :group => :test
50 |
51 | inject_into_file "config/application.rb", :after => "config.generators do |generator|\n" do
52 | (" " * 6) + "generator.fixture_replacement :factory_girl, :dir => '#{@use_rspec ? "spec/factories" : "test/factories"}'\n"
53 | end
54 |
55 | # TODO: inject require 'factory_girl' into spec_helper if @user_rspec
56 |
57 | end
--------------------------------------------------------------------------------
/README.markdown:
--------------------------------------------------------------------------------
1 | # IMPORTANT NOTE #
2 | As of Rails 3.0.5 using application templates remotely over HTTPS (from github) works like a charm. With versions lower than 3.0.5, it still won't work.
3 |
4 | # Template Bucket
5 |
6 | Awesome Rails 3 project template, full of rainbows, ponies and unicorns... and awesomeness.
7 | These templates are knowingly a bit opinionated, but feel free to leave feedback about what you would like to do differently.
8 |
9 | ### Prerequisites
10 |
11 | - [RVM] (http://rvm.beginrescueend.com/)
12 | - Ruby 1.9.2 (installed via RVM) - `rvm install 1.9.2`
13 | - Rails 3 (installed in ruby-1.9.2 in RVM) - `rvm use 1.9.2; gem install rails`
14 |
15 | ### Usage
16 |
17 | The templates work both locally and remotely referenced.
18 | You can clone the repo and reference to it from your filesystem, or use the urls directly from github.
19 |
20 | The most basic usage would be `rails new appname -m https://github.com/perfectline/template-bucket/raw/master/full.rb`.
21 |
22 | All of the subtemplates can also be used separately, so you can mix and match them according to your own taste.
23 |
24 | ### Modules
25 | #### Cleanup
26 | Removes `README`, `doc/`, `index.html`, `rails.png` and `favicon.ico`.
27 | Removes all lines from Gemfile prefixed with # (commented lines).
28 | Also adds the config generators block to `application.rb`.
29 |
30 | #### Database
31 | Cleans up the `database.yml` file, reusing basic declarations.
32 | Also adds the `generator.orm :active_record` statement to `application.rb`
33 |
34 | #### Cucumber
35 | Installs gems needed by cucumber either with Webrat or Capybara, runs the cucumber generator and replaces the default cucumber.yml
36 |
37 | #### RSpec
38 | Installs gems needed to use RSpec with Rails, replaces .rspec configuration, runs the RSpec generator, removes `test/` folder, adds `generator.test_framework :rspec, :view => false` to `application.rb`.
39 | Optionally prompts for installing Shoulda and FactoryGirl.
40 |
41 | When Mocha is chosen, adds mocking warnigs to `spec_helper.rb` and configures RSpec with `config.mock_with :mocha`.
42 |
43 | When FactoryGirl is chosen, sets the `config.fixture_replacement :factory_girl` with appropriate director in `application.rb`.
44 | Fixture replacement directory depends on the test framework used - with RSpec its `spec/factories`, with Test::Unit its `test/factories`
45 |
46 | #### jQuery
47 | Removes the default Prototype library with its helpers, replaces it with jQuery 1.4.2, downloads the Rails jQuery integration and adds the jQuery.metadata plugin.
48 | Additionally replaces the `:defaults` javascript expansion with the newly added files.
49 |
50 | #### Gems
51 | Adds the `rails3-generators` gem, optionally prompts for Jammit and Haml installation.
52 | When using Jammit, it also creates the default `assets.yml` with default javascripts and `reset.css`.
53 | Using Haml adds the `generator.template_engine :haml` directive to `application.rb`.
54 |
55 | #### Layout
56 | Adds a `reset.css` file under `public/stylesheets` which contains basic CSS reset directives.
57 | In addition creates the default application layout, proper XHTML Strict file.
58 | When using HAML, the template will be in HAML as expected.
59 | When using Jammit, the default javascript and stylesheet tags are replaced with Jammit shortcuts.
60 |
61 | #### Bootstrap
62 | Optionally installs all gems via bundle and creates the development database.
63 |
64 | #### Capistrano
65 | Optionally adds capistrano support for the project, bootstrapping the application.
66 | This will get future enhanchements.
67 |
68 | #### Git
69 | Replaces the default .gitignore, initializes a new repository, adds all files and does an initial commit.
70 | If chosen, it will also add a new remote to the repo.
71 |
72 | If the user has a `~/.template-bucket/repositories` file, containing a list of repository locations (one location per line), the file will be used to prompt with predefined repository locations. You can use a placeholder `` in your dotfile, which will be replaced with the current application name.
73 |
74 | If no dotfile is found, the template will prompt for a full repository location, including the project name.
75 |
76 | ### TODO
77 | Mongoid/Mongomapper support, Resque support, pre-configured Capistrano recipes.
78 | What else am I missing?
79 |
80 | ## Authors
81 |
82 | **Tanel Suurhans** ()
83 | **Tarmo Lehtpuu** ()
84 |
85 | ## License
86 | Copyright 2010 by PerfectLine LLC () and is released under the MIT license.
87 |
--------------------------------------------------------------------------------