Permalink
Browse files

Regen prebuilt files

  • Loading branch information...
1 parent fe72f2e commit e4c31bd5054a01dffcdb3d7f26b5f2aeb46d305f @kgrz kgrz committed Mar 12, 2013
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -6,9 +6,9 @@
the files contains specific environment settings and it will use the
corresponding to the current one.</p>
-<p>Within the application you can access those options through
-<tt>settings</tt>. If you try to get the value for a setting that hasn't
-been defined in the config file for the current environment, you will get
+<p>You can access those options through <tt>settings</tt> within the
+application. If you try to get the value for a setting that hasn’t been
+defined in the config file for the current environment, you will get
whatever it was set to in the application.</p>
<h2>Usage</h2>
@@ -90,6 +90,20 @@
<p>Be aware that if you have a different environment, besides development,
test and production, you will also need to adjust the <tt>environments</tt>
-setting. For instance, when you also have a staging environment:</p>
+setting, otherwise the settings will not load. For instance, when you also
+have a staging environment:</p>
<pre>set :environments, %w{development test production staging}</pre>
+
+<p>If you wish to provide defaults that may be shared among all the
+environments, this can be done by using one of the existing environments as
+the default using the YAML alias, and then overwriting values in the other
+environments:</p>
+
+<pre>development: &amp;common_settings
+ foo: 'foo'
+ bar: 'bar'
+
+production:
+ &lt;&lt;: *common_settings
+ bar: 'baz' # override the default value</pre>
@@ -50,7 +50,7 @@
<h2>And How Is This Useful?</h2>
<p>For example, some of your views might need a few javascript tags and
-stylesheets, but you don't want to force this files in all your pages. Then
+stylesheets, but you dont want to force this files in all your pages. Then
@rkh

rkh Mar 12, 2013

Owner

Did this happen automatically or did you do this manually?

@kgrz

kgrz Mar 12, 2013

Member

Did this manually. Shouldn't this be included?

you can put <tt>&lt;% yield_content :scripts_and_styles %&gt;</tt> on your
layout, inside the &lt;head&gt; tag, and each view can call
<tt>content_for</tt> setting the appropriate set of tags that should be
@@ -8,7 +8,7 @@
<p>Allows you to read cookies:</p>
<pre>get '/' do
- &quot;value: #{cookie[:something]}&quot;
+ &quot;value: #{cookies[:something]}&quot;
end</pre>
<p>And of course to write cookies:</p>
@@ -39,7 +39,7 @@
<h3>Modular Application</h3>
<p>In a modular application you need to require the helpers, and then tell the
-application you will use them:</p>
+application to use them:</p>
<pre>require &quot;sinatra/base&quot;
require &quot;sinatra/cookies&quot;
@@ -2,12 +2,12 @@
<h1>Sinatra::Extension</h1>
<p><tt>Sinatra::Extension</tt> is a mixin that provides some syntactic sugar
-for your extensions. It allows you to call directly inside your extension
-module almost any <tt>Sinatra::Base</tt> method. This means you can use
-<tt>get</tt> to define a route, <tt>before</tt> to define a before filter,
-<tt>set</tt> to define a setting, a so on.</p>
+for your extensions. It allows you to call almost any
+<tt>Sinatra::Base</tt> method directly inside your extension module. This
+means you can use <tt>get</tt> to define a route, <tt>before</tt> to define
+a before filter, <tt>set</tt> to define a setting and so on.</p>
-<p>Is important to be aware that this mixin remembers the methods calls you
+<p>Is important to be aware that this mixin remembers the method calls you
make, and then, when your extension is registered, replays them on the
Sinatra application that has been extended. In order to do that, it
defines a <tt>registered</tt> method, so, if your extension defines one
@@ -41,8 +41,8 @@
<h3>Encoders</h3>
-<p>Per default it will try to call <tt>to_json</tt> on the object, but if it
-doesn't respond to that message, will use its own, rather simple encoder.
+<p>By default it will try to call <tt>to_json</tt> on the object, but if it
+doesnt respond to that message, it will use its own rather simple encoder.
You can easily change that anyways. To use <tt>JSON</tt>, simply require
it:</p>
@@ -69,7 +69,7 @@
<h3>Content-Type</h3>
-<p>It will automatically set the content type to "application/json". As
+<p>It will automatically set the content type to application/json. As
usual, you can easily change that, with the <tt>:json_content_type</tt>
setting:</p>
@@ -17,6 +17,12 @@
# ...
end</pre>
+<p>Or for multiple verbs and multiple routes:</p>
+
+<pre>route :get, :post, ['/foo', '/bar'] do
+ # ...
+end</pre>
+
<p>Or even for custom verbs:</p>
<pre>route 'LIST', '/' do
@@ -9,7 +9,7 @@
<h2>Usage</h2>
-<p>Once you have loaded the extension (see below), you use the
+<p>Once you have loaded the extension (see below), you can use the
<tt>namespace</tt> method to define namespaces in your application.</p>
<p>You can define a namespace by a path prefix:</p>
@@ -10,7 +10,7 @@
<h3>Classic Application</h3>
-<p>To enable the realoader in a classic application all you need to do is
+<p>To enable the reloader in a classic application all you need to do is
require it:</p>
<pre>require &quot;sinatra&quot;
@@ -20,7 +20,7 @@
<h3>Modular Application</h3>
-<p>To enable the realoader in a modular application all you need to do is
+<p>To enable the reloader in a modular application all you need to do is
require it, and then, register it:</p>
<pre>require &quot;sinatra/base&quot;
@@ -1,8 +1,8 @@
<h1>Sinatra::RespondWith</h1>
-<p>This extensions lets Sinatra automatically choose what template to render
-or action to perform depending on the request's Accept header.</p>
+<p>These extensions let Sinatra automatically choose what template to render
+or action to perform depending on the requests Accept header.</p>
<p>Example:</p>
@@ -54,9 +54,9 @@
<h2>Security</h2>
<p>Since methods are triggered based on client input, this can lead to
-security issues (but not as seviere as those might apear in the first
-place: keep in mind that only known file extensions are used). You
-therefore should limit the possible formats you serve.</p>
+security issues (but not as severe as those might appear in the first
+place: keep in mind that only known file extensions are used). You should
+limit the possible formats you serve.</p>
<p>This is possible with the <tt>provides</tt> condition:</p>
@@ -65,7 +65,7 @@
end</pre>
<p>However, since you have to set <tt>provides</tt> for every route, this
-extension adds a app global (class method) `respond_to`, that let's you
+extension adds an app global (class method) `respond_to`, that lets you
define content types for all routes:</p>
<pre>respond_to :html, :json, :xml, :atom
@@ -2,7 +2,7 @@
<h1>Sinatra::Streaming</h1>
<p>Sinatra 1.3 introduced the <tt>stream</tt> helper. This addon improves the
-streaming API by making the stream object immitate an IO object, turing it
+streaming API by making the stream object immitate an IO object, turning it
into a real Deferrable and making the body play nicer with middleware
unaware of streaming.</p>
@@ -39,9 +39,9 @@
<h2>Better Middleware Handling</h2>
-<p>Blocks passed to #map! or #map will actually be applied while streaming (as
-you might suspect, #map! applies modifications to the current body, #map
-creates a new one):</p>
+<p>Blocks passed to #map! or #map will actually be applied when streaming
+takes place (as you might have suspected, #map! applies modifications to
+the current body, while #map creates a new one):</p>
<pre>class StupidMiddleware
def initialize(app) @app = app end

0 comments on commit e4c31bd

Please sign in to comment.