Return nil from capture id result isn't a String

Rail's capture helper returns nil if nothing is written to the buffer
and the result of the block isn't a String.

Change Haml's helper to match this behaviour.

Fixes #439
(cherry picked from commit 754ac46ec73cb8a6cbeee0f5ceba77439237ebd9)
Check for nil in Rails 3.0
(cherry picked from commit ccfcd6497f8ee093408c297023141b665d08459d)
Pin Nokogiri to 1.5

Nokogiri 1.6 doesn't build on Ruby 1.8.7.
Allow literal '#' with suppress_eval

Improve the regex that detects whether an attribute value can be treated
as a literal to allow lone '#' characters. Explicitly check for '#{',
'#@' and '#$'.

Fixes #713
Fix error in documentation

Fixes #717
escape_once works on frozen strings.

That way, it works the same way as #html_escape and
ERB::Util.html_escape_once for which it acts as a replacement in Rails.

Furthermore, it is not obvious from the method name that the string
given as an argument is being changed.
Merge pull request #721 from patrik/stable

escape_once does not work on frozen strings
Allow profiling templates from any directory
Updated changelog
Making tests green by modifying the partial_layout_erb template test

When using <%= , ActionView is escaping the result for safety purposes
so it will be better to remove the tags from the test
Check for Rails::Railtie specifically
documentation: combining object reference and class attribute
Prepped 4.0.4 release
Merge branch 'stable'

Conflicts:
	CHANGELOG.md
	lib/haml/version.rb
	test/helper_test.rb
Bump version