Merge branch 'master' of github.com:sinatra/sinatra

Conflicts:
	Gemfile
This commit is contained in:
Konstantin Haase 2013-03-10 08:46:59 +01:00
commit 9543429bce
3 changed files with 891 additions and 704 deletions

View File

@ -41,10 +41,11 @@ gem 'maruku'
gem 'creole'
gem 'markaby'
gem 'radius'
gem 'rabl' unless RUBY_ENGINE =~ /jruby|maglev/
gem 'rabl' unless RUBY_ENGINE =~ /jruby|maglev/
gem 'wlang', '>= 2.0.1' unless RUBY_ENGINE =~ /jruby|rbx/
gem 'therubyracer' unless RUBY_ENGINE =~ /jruby|rbx/
gem 'redcarpet' unless RUBY_ENGINE == 'jruby'
gem 'therubyracer' unless RUBY_ENGINE =~ /jruby|rbx/
gem 'redcarpet' unless RUBY_ENGINE == 'jruby'
gem 'bluecloth' unless RUBY_ENGINE == 'jruby'
if RUBY_ENGINE != 'rbx' or RUBY_VERSION < '1.9'
gem 'liquid'

File diff suppressed because it is too large Load Diff

View File

@ -484,21 +484,16 @@ Available Options:
Special options only used for rendering the layout. Example:
<tt>set :rdoc, :layout_options => { :views => 'views/layouts' }</tt>
</dd>
<dd>
Templates are assumed to be located directly under the `./views`
directory. To use a different views directory:
<tt>set :views, settings.root + '/templates'</tt>
</dd>
<dd>
One important thing to remember is that you always have to reference
templates with symbols, even if they're in a subdirectory (in this
case, use: <tt>'subdir/template'</tt>). You must use a symbol because
otherwise rendering methods will render any strings passed to them
directly.
</dd>
</dl>
Templates are assumed to be located directly under the `./views` directory. To
use a different views directory:
<tt>set :views, settings.root + '/templates'</tt>
One important thing to remember is that you always have to reference templates
with symbols, even if they're in a subdirectory (in this case, use:
<tt>'subdir/template'</tt>). You must use a symbol because otherwise rendering
methods will render any strings passed to them directly.
#### Literal Templates
@ -977,14 +972,15 @@ end
The template source is evaluated as a Ruby string, and the
resulting json variable is converted using `#to_json`.
resulting json variable is converted using `#to_json`:
``` ruby
json = { :foo => 'bar' }
json[:baz] = key
```
The `:callback` and `:variable` options can be used to decorate the rendered object.
The `:callback` and `:variable` options can be used to decorate the rendered
object:
``` ruby
var resource = {"foo":"bar","baz":"qux"}; present(resource);
@ -2013,7 +2009,7 @@ set :protection, :session => true
</dd>
<dt>bind</dt>
<dd>IP address to bind to (default: 0.0.0.0). Only used for built-in server.</dd>
<dd>IP address to bind to (default: <tt>0.0.0.0</tt>). Only used for built-in server.</dd>
<dt>default_encoding</dt>
<dd>encoding to assume if unknown (defaults to <tt>"utf-8"</tt>).</dd>
@ -2094,7 +2090,7 @@ set :protection, :session => true
<dt>server</dt>
<dd>
server or list of servers to use for built-in server. defaults to
['thin', 'mongrel', 'webrick'], order indicates priority.
<tt>['thin', 'mongrel', 'webrick']</tt>, order indicates priority.
</dd>
<dt>sessions</dt>
@ -2150,7 +2146,7 @@ set :protection, :session => true
<dt>x_cascade</dt>
<dd>
Whether or not to set the X-Cascade header if no route matches.
Defaults to `true`.
Defaults to <tt>true</tt>.
</dd>
</dl>