[3.6.1] Add binstubs to .gitignore

The first and preferred method is to use the RVM Bundler integration
to configure the Ruby Version Manager to include the proper executables
automatically in the local environment. The steps are simple if somewhat
mysterious. First, run these two commands:

    $ rvm get head && rvm reload
    $ chmod +x $rvm_path/hooks/after_cd_bundler

Then run these:

    $ cd ~/rails_projects/sample_app
    $ bundle install --without production --binstubs=./bundler_stubs

Together, these commands combine RVM and Bundler magic to ensure that
commands such as rake and rspec are automatically executed in the right
environment. Since these files are specific to your local setup, you
should add the bundler_stubs directory to your .gitignore file.

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:eliminating_bundle_exec
[3.6.2] Add Guard gem for automated testing

One annoyance associated with using the rspec command is having to
switch to the command line and run the tests by hand. (A second
annoyance, the slow start-up time of the test suite, is addressed in
Section 3.6.3.) In this section, we’ll show how to use Guard to
automate the running of the tests. Guard monitors changes in the
filesystem so that, for example, when we change the static_pages_spec.rb
file only those tests get run. Even better, we can configure Guard so
that when, say, the home.html.erb file is modified, the
static_pages_spec.rb automatically runs.

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:guard
[3.6.2] Set Guardfile up correctly

Now edit the resulting Guardfile so that Guard will run the right tests
when the integration tests and views are updated.

Here the line

    guard 'rspec', :version => 2, :all_after_pass => false do

ensures that Guard doesn't run all the tests after a failing test
passes (to speed up the Red-Green-Refactor cycle).

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:guard
[3.6.3] Add Spork gem for faster RSpec testing

When running bundle exec rspec, you may have noticed that it takes
several seconds just to start running the tests, but once they start
running they finish quickly. This is because each time RSpec runs the
tests it has to reload the entire Rails environment. The Spork test
server aims to solve this problem. Spork loads the environment once, and
then maintains a pool of processes for running future tests. Spork is
particularly useful when combined with Guard.

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:spork
[3.6.3] Load RSpec environment in a prefork block

Now we need to edit the RSpec configuration file, located in
spec/spec_helper.rb, so that the environment gets loaded in a prefork
block, which arranges for it to be loaded only once.

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:spork
[3.6.3] Make RSpec use spork by default

It’s inconvenient to have to include the --drb option every time we run
rspec, so I recommend adding it to the .rspec file in the application’s
root directory.

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:spork
[3.6.3] Tell Guard to use Spork

Note that we've updated the arguments to guard to include :cli =>
--drb, which ensures that Guard uses the command-line interface (cli) to
the Spork server. We've also added a command to watch the spec/support/
directory, which we’ll start modifying in Chapter 5.

With that configuration in place, we can start Guard and Spork at the
same time with the guard command:

    $ bundle exec guard

Guard automatically starts a Spork server, dramatically reducing the
overhead each time a test gets run.

[Source] http://ruby.railstutorial.org/chapters/static-pages#sec:spork
Merge branch 'advanced-setup'
[4.1] Remove "Home" portion of title on homepage

What if we don’t provide a title? It's a good convention to have a base
title we use on every page, with an optional page title if we want to be
more specific. We've almost achieved that with our current layout, with
one wrinkle: as you can see if you delete the provide call in one of the
views, in the absence of a page-specific title the full title appears as
follows:

    Ruby on Rails Tutorial Sample App |

In other words, there's a suitable base title, but there's also a
trailing vertical bar character | at the end.

To solve the problem of a missing page title, we'll define a custom
helper called full_title. The full_title helper returns a base title,
"Ruby on Rails Tutorial Sample App", if no page title is defined, and
adds a vertical bar followed by the page title if one is defined.

[Source] http://ruby.railstutorial.org/chapters/rails-flavored-ruby#sec:motivation
Merge branch 'rails-flavoured-ruby'