Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

API docs are at railsapi.com now

  • Loading branch information...
commit 9e15a8cabd96713b4a1646fe31014eec2f23a918 1 parent 5e2df7a
Ryan Tomayko authored March 07, 2010

Showing 38 changed files with 8 additions and 10,193 deletions. Show diff stats Hide diff stats

  1. 148  api/classes/Sinatra.html
  2. 73  api/classes/Sinatra/Application.html
  3. 610  api/classes/Sinatra/Base.html
  4. 401  api/classes/Sinatra/Helpers.html
  5. 130  api/classes/Sinatra/Request.html
  6. 86  api/classes/Sinatra/Response.html
  7. 107  api/classes/Sinatra/ShowExceptions.html
  8. 167  api/classes/Sinatra/Templates.html
  9. 168  api/classes/Tilt.html
  10. 125  api/classes/Tilt/BuilderTemplate.html
  11. 121  api/classes/Tilt/Cache.html
  12. 111  api/classes/Tilt/CoffeeTemplate.html
  13. 91  api/classes/Tilt/CompileSite.html
  14. 153  api/classes/Tilt/ERBTemplate.html
  15. 139  api/classes/Tilt/ErubisTemplate.html
  16. 160  api/classes/Tilt/HamlTemplate.html
  17. 114  api/classes/Tilt/LessTemplate.html
  18. 126  api/classes/Tilt/LiquidTemplate.html
  19. 127  api/classes/Tilt/MustacheTemplate.html
  20. 130  api/classes/Tilt/RDiscountTemplate.html
  21. 116  api/classes/Tilt/RDocTemplate.html
  22. 111  api/classes/Tilt/RedClothTemplate.html
  23. 114  api/classes/Tilt/SassTemplate.html
  24. 97  api/classes/Tilt/StringTemplate.html
  25. 446  api/classes/Tilt/Template.html
  26. 1  api/created.rid
  27. 156  api/files/AUTHORS.html
  28. 84  api/files/CHANGES.html
  29. 490  api/files/README_rdoc.html
  30. 64  api/files/lib/sinatra/base_rb.html
  31. 64  api/files/lib/sinatra/main_rb.html
  32. 57  api/files/lib/sinatra/showexceptions_rb.html
  33. 57  api/files/lib/sinatra/tilt_rb.html
  34. 21  api/fr_class_index.html
  35. 26  api/fr_file_index.html
  36. 4,663  api/fr_method_index.html
  37. 19  api/index.html
  38. 328  api/rdoc-style.css
148  api/classes/Sinatra.html
... ...
@@ -1,148 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2  
-<html lang='en'>
3  
-  <head>
4  
-    <title>: Sinatra [Sinatra API Documentation]</title>
5  
-    <meta content='text/html; charset=utf8' http-equiv='Content-Type'>
6  
-    <link href='../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7  
-    <script type='text/javascript'>
8  
-      //<![CDATA[
9  
-        function popupCode(url) {
10  
-          window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11  
-        }
12  
-        
13  
-        function toggleCode(id) {
14  
-          var code = document.getElementById(id)
15  
-        
16  
-          code.style.display = code.style.display != 'block' ? 'block' : 'none'
17  
-          return true
18  
-        }
19  
-        
20  
-        // Make codeblocks hidden by default
21  
-        document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22  
-      //]]>
23  
-    </script>
24  
-  </head>
25  
-  <body class='page'>
26  
-    <div class='class' id='wrapper'>
27  
-      <div class='header'>
28  
-        <h1 class='name'>
29  
-          <span class='type'>Module</span>
30  
-          Sinatra
31  
-        </h1>
32  
-        <ol class='paths'>
33  
-          <li>
34  
-            <a href="../files/lib/sinatra/main_rb.html">lib/sinatra/main.rb</a>
35  
-          </li>
36  
-          <li class='other'>
37  
-            <a href="../files/lib/sinatra/base_rb.html">lib/sinatra/base.rb</a>
38  
-          </li>
39  
-          <li class='other'>
40  
-            <a href="../files/lib/sinatra/showexceptions_rb.html">lib/sinatra/showexceptions.rb</a>
41  
-          </li>
42  
-          <li>
43  
-            <a class='show' href='#' onclick='this.parentNode.parentNode.className += " expanded"; this.parentNode.removeChild(this); return false'>show all</a>
44  
-          </li>
45  
-        </ol>
46  
-      </div>
47  
-      <div id='content'>
48  
-        <div id='text'>
49  
-          <div id='method-list'>
50  
-            <h2>Methods</h2>
51  
-            <h3>public class</h3>
52  
-            <ol>
53  
-              <li><a href="#M000003">helpers</a></li>
54  
-              <li><a href="#M000001">new</a></li>
55  
-              <li><a href="#M000002">register</a></li>
56  
-            </ol>
57  
-          </div>
58  
-          <div id='section'>
59  
-            <div id='class-list'>
60  
-              <h2>Classes and Modules</h2>
61  
-              Module <a href="Sinatra/Helpers.html" class="link">Sinatra::Helpers</a><br />
62  
-              Module <a href="Sinatra/Templates.html" class="link">Sinatra::Templates</a><br />
63  
-              Class <a href="Sinatra/Application.html" class="link">Sinatra::Application</a><br />
64  
-              Class <a href="Sinatra/Base.html" class="link">Sinatra::Base</a><br />
65  
-              Class <a href="Sinatra/Request.html" class="link">Sinatra::Request</a><br />
66  
-              Class <a href="Sinatra/Response.html" class="link">Sinatra::Response</a><br />
67  
-              Class <a href="Sinatra/ShowExceptions.html" class="link">Sinatra::ShowExceptions</a><br />
68  
-            </div>
69  
-            <div id='constants-list'>
70  
-              <h2>Constants</h2>
71  
-              <div class='name-list'>
72  
-                <table summary='Constants'>
73  
-                  <tr class='top-aligned-row context-row'>
74  
-                    <td class='context-item-name'>VERSION</td>
75  
-                    <td>=</td>
76  
-                    <td class='context-item-value'>'1.0.b'</td>
77  
-                  </tr>
78  
-                </table>
79  
-              </div>
80  
-            </div>
81  
-            <div id='methods'>
82  
-              <h2>Public class methods</h2>
83  
-              <div class='method public-class' id='method-M000003'>
84  
-                <a name='M000003'></a>
85  
-                <div class='synopsis'>
86  
-                  <span class='name'>helpers</span>
87  
-                  <span class='arguments'>(*extensions, &amp;block)</span>
88  
-                </div>
89  
-                <div class='description'>
90  
-                  <p>
91  
-                  Include the helper modules provided in Sinatra&#8217;s request context.
92  
-                  </p>
93  
-                </div>
94  
-                <div class='source'>
95  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000003-source'); return false">
96  
-                    [show source]
97  
-                  </a>
98  
-                  <pre id='M000003-source'>      <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 1177</span>&#x000A;1177:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">helpers</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;1178:     <span class="ruby-constant">Application</span>.<span class="ruby-identifier">helpers</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;1179:   <span class="ruby-keyword kw">end</span></pre>
99  
-                </div>
100  
-              </div>
101  
-              <div class='method public-class' id='method-M000001'>
102  
-                <a name='M000001'></a>
103  
-                <div class='synopsis'>
104  
-                  <span class='name'>new</span>
105  
-                  <span class='arguments'>(base=Base, options={}, &amp;block)</span>
106  
-                </div>
107  
-                <div class='description'>
108  
-                  <p>
109  
-                  Create a new <a href="Sinatra.html">Sinatra</a> application. The block is
110  
-                  evaluated in the new app&#8217;s class scope.
111  
-                  </p>
112  
-                </div>
113  
-                <div class='source'>
114  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000001-source'); return false">
115  
-                    [show source]
116  
-                  </a>
117  
-                  <pre id='M000001-source'>      <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 1165</span>&#x000A;1165:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">base</span>=<span class="ruby-constant">Base</span>, <span class="ruby-identifier">options</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;1166:     <span class="ruby-identifier">base</span> = <span class="ruby-constant">Class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">base</span>)&#x000A;1167:     <span class="ruby-identifier">base</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:class_eval</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>&#x000A;1168:     <span class="ruby-identifier">base</span>&#x000A;1169:   <span class="ruby-keyword kw">end</span></pre>
118  
-                </div>
119  
-              </div>
120  
-              <div class='method public-class' id='method-M000002'>
121  
-                <a name='M000002'></a>
122  
-                <div class='synopsis'>
123  
-                  <span class='name'>register</span>
124  
-                  <span class='arguments'>(*extensions, &amp;block)</span>
125  
-                </div>
126  
-                <div class='description'>
127  
-                  <p>
128  
-                  Extend the top-level DSL with the modules provided.
129  
-                  </p>
130  
-                </div>
131  
-                <div class='source'>
132  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000002-source'); return false">
133  
-                    [show source]
134  
-                  </a>
135  
-                  <pre id='M000002-source'>      <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 1172</span>&#x000A;1172:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;1173:     <span class="ruby-constant">Application</span>.<span class="ruby-identifier">register</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;1174:   <span class="ruby-keyword kw">end</span></pre>
136  
-                </div>
137  
-              </div>
138  
-            </div>
139  
-          </div>
140  
-        </div>
141  
-      </div>
142  
-      <div id='footer-push'></div>
143  
-    </div>
144  
-    <div id='footer'>
145  
-      <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
146  
-    </div>
147  
-  </body>
148  
-</html>
73  api/classes/Sinatra/Application.html
... ...
@@ -1,73 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2  
-<html lang='en'>
3  
-  <head>
4  
-    <title>: Sinatra::Application [Sinatra API Documentation]</title>
5  
-    <meta content='text/html; charset=utf8' http-equiv='Content-Type'>
6  
-    <link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7  
-    <script type='text/javascript'>
8  
-      //<![CDATA[
9  
-        function popupCode(url) {
10  
-          window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11  
-        }
12  
-        
13  
-        function toggleCode(id) {
14  
-          var code = document.getElementById(id)
15  
-        
16  
-          code.style.display = code.style.display != 'block' ? 'block' : 'none'
17  
-          return true
18  
-        }
19  
-        
20  
-        // Make codeblocks hidden by default
21  
-        document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22  
-      //]]>
23  
-    </script>
24  
-  </head>
25  
-  <body class='page'>
26  
-    <div class='class' id='wrapper'>
27  
-      <div class='header'>
28  
-        <h1 class='name'>
29  
-          <span class='type'>Class</span>
30  
-          Sinatra::Application
31  
-        </h1>
32  
-        <ol class='paths'>
33  
-          <li>
34  
-            <a href="../../files/lib/sinatra/main_rb.html">lib/sinatra/main.rb</a>
35  
-          </li>
36  
-          <li class='other'>
37  
-            <a href="../../files/lib/sinatra/base_rb.html">lib/sinatra/base.rb</a>
38  
-          </li>
39  
-          <li>
40  
-            <a class='show' href='#' onclick='this.parentNode.parentNode.className += " expanded"; this.parentNode.removeChild(this); return false'>show all</a>
41  
-          </li>
42  
-        </ol>
43  
-        <div class='parent'>
44  
-          Parent:
45  
-          <strong><a href="Base.html">Sinatra::Base</a></strong>
46  
-        </div>
47  
-      </div>
48  
-      <div id='content'>
49  
-        <div id='text'>
50  
-          <div id='description'>
51  
-            <p>
52  
-            Execution context for classic style (top-level) applications. All DSL
53  
-            methods executed on main are delegated to this class.
54  
-            </p>
55  
-            <p>
56  
-            The <a href="Application.html">Application</a> class should not be
57  
-            subclassed, unless you want to inherit all settings, routes, handlers, and
58  
-            error pages from the top-level. Subclassing <a
59  
-            href="Base.html">Sinatra::Base</a> is heavily recommended for modular
60  
-            applications.
61  
-            </p>
62  
-          </div>
63  
-          <div id='section'>
64  
-          </div>
65  
-        </div>
66  
-      </div>
67  
-      <div id='footer-push'></div>
68  
-    </div>
69  
-    <div id='footer'>
70  
-      <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
71  
-    </div>
72  
-  </body>
73  
-</html>
610  api/classes/Sinatra/Base.html
... ...
@@ -1,610 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2  
-<html lang='en'>
3  
-  <head>
4  
-    <title>: Sinatra::Base [Sinatra API Documentation]</title>
5  
-    <meta content='text/html; charset=utf8' http-equiv='Content-Type'>
6  
-    <link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7  
-    <script type='text/javascript'>
8  
-      //<![CDATA[
9  
-        function popupCode(url) {
10  
-          window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11  
-        }
12  
-        
13  
-        function toggleCode(id) {
14  
-          var code = document.getElementById(id)
15  
-        
16  
-          code.style.display = code.style.display != 'block' ? 'block' : 'none'
17  
-          return true
18  
-        }
19  
-        
20  
-        // Make codeblocks hidden by default
21  
-        document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22  
-      //]]>
23  
-    </script>
24  
-  </head>
25  
-  <body class='page'>
26  
-    <div class='class' id='wrapper'>
27  
-      <div class='header'>
28  
-        <h1 class='name'>
29  
-          <span class='type'>Class</span>
30  
-          Sinatra::Base
31  
-        </h1>
32  
-        <ol class='paths'>
33  
-          <li>
34  
-            <a href="../../files/lib/sinatra/base_rb.html">lib/sinatra/base.rb</a>
35  
-          </li>
36  
-        </ol>
37  
-        <div class='parent'>
38  
-          Parent:
39  
-          <strong>Object</strong>
40  
-        </div>
41  
-      </div>
42  
-      <div id='content'>
43  
-        <div id='text'>
44  
-          <div id='description'>
45  
-            <p>
46  
-            <a href="Base.html">Base</a> class for all <a
47  
-            href="../Sinatra.html">Sinatra</a> applications and middleware.
48  
-            </p>
49  
-          </div>
50  
-          <div id='method-list'>
51  
-            <h2>Methods</h2>
52  
-            <h3>public class</h3>
53  
-            <ol>
54  
-              <li><a href="#M000052">call</a></li>
55  
-              <li><a href="#M000053">caller_files</a></li>
56  
-              <li><a href="#M000054">caller_locations</a></li>
57  
-              <li><a href="#M000047">configure</a></li>
58  
-              <li><a href="#M000040">delete</a></li>
59  
-              <li><a href="#M000044">development?</a></li>
60  
-              <li><a href="#M000037">get</a></li>
61  
-              <li><a href="#M000041">head</a></li>
62  
-              <li><a href="#M000042">helpers</a></li>
63  
-              <li><a href="#M000029">new</a></li>
64  
-              <li><a href="#M000051">new</a></li>
65  
-              <li><a href="#M000039">post</a></li>
66  
-              <li><a href="#M000045">production?</a></li>
67  
-              <li><a href="#M000050">prototype</a></li>
68  
-              <li><a href="#M000038">put</a></li>
69  
-              <li><a href="#M000043">register</a></li>
70  
-              <li><a href="#M000049">run!</a></li>
71  
-              <li><a href="#M000046">test?</a></li>
72  
-              <li><a href="#M000048">use</a></li>
73  
-            </ol>
74  
-            <h3>public instance</h3>
75  
-            <ol>
76  
-              <li><a href="#M000030">call</a></li>
77  
-              <li><a href="#M000031">call!</a></li>
78  
-              <li><a href="#M000036">forward</a></li>
79  
-              <li><a href="#M000034">halt</a></li>
80  
-              <li><a href="#M000033">options</a></li>
81  
-              <li><a href="#M000035">pass</a></li>
82  
-              <li><a href="#M000032">settings</a></li>
83  
-            </ol>
84  
-          </div>
85  
-          <div id='context'>
86  
-            <div id='includes'>
87  
-              <h2>Included modules</h2>
88  
-              <ol>
89  
-                <li>Rack::Utils</li>
90  
-                <li><a href="Helpers.html">Helpers</a></li>
91  
-                <li><a href="Templates.html">Templates</a></li>
92  
-              </ol>
93  
-            </div>
94  
-          </div>
95  
-          <div id='section'>
96  
-            <div id='constants-list'>
97  
-              <h2>Constants</h2>
98  
-              <div class='name-list'>
99  
-                <table summary='Constants'>
100  
-                  <tr class='top-aligned-row context-row'>
101  
-                    <td class='context-item-name'>CALLERS_TO_IGNORE</td>
102  
-                    <td>=</td>
103  
-                    <td class='context-item-value'>[         /\/sinatra(\/(base|main|showexceptions))?\.rb$/, # all sinatra code         /lib\/tilt.*\.rb$/,    # all tilt code         /\(.*\)/,              # generated code         /custom_require\.rb$/, # rubygems require hacks         /active_support/,      # active_support require hacks       ]</td>
104  
-                  </tr>
105  
-                </table>
106  
-              </div>
107  
-            </div>
108  
-            <div id='aliases-list'>
109  
-              <h2>External Aliases</h2>
110  
-              <div class='name-list'>
111  
-                <table summary='External aliases'>
112  
-                  <tr class='top-aligned-row context-row'>
113  
-                    <td class='context-item-name'>user_agent</td>
114  
-                    <td>-&gt;</td>
115  
-                    <td class='context-item-value'>agent</td>
116  
-                  </tr>
117  
-                  <tr class='top-aligned-row context-row'>
118  
-                    <td class='context-item-name'>method_override?</td>
119  
-                    <td>-&gt;</td>
120  
-                    <td class='context-item-value'>methodoverride?</td>
121  
-                  </tr>
122  
-                  <tr class='top-aligned-row context-row'>
123  
-                    <td class='context-item-name'>method_override=</td>
124  
-                    <td>-&gt;</td>
125  
-                    <td class='context-item-value'>methodoverride=</td>
126  
-                  </tr>
127  
-                </table>
128  
-              </div>
129  
-            </div>
130  
-            <div id='attribute-list'>
131  
-              <h2 class='section-bar'>Attributes</h2>
132  
-              <div class='name-list'>
133  
-                <table>
134  
-                  <tr class='top-aligned-row context-row'>
135  
-                    <td class='context-item-name'>after_filters</td>
136  
-                    <td class='context-item-value'>[R]</td>
137  
-                    <td class='context-item-desc'></td>
138  
-                  </tr>
139  
-                  <tr class='top-aligned-row context-row'>
140  
-                    <td class='context-item-name'>app</td>
141  
-                    <td class='context-item-value'>[RW]</td>
142  
-                    <td class='context-item-desc'></td>
143  
-                  </tr>
144  
-                  <tr class='top-aligned-row context-row'>
145  
-                    <td class='context-item-name'>before_filters</td>
146  
-                    <td class='context-item-value'>[R]</td>
147  
-                    <td class='context-item-desc'></td>
148  
-                  </tr>
149  
-                  <tr class='top-aligned-row context-row'>
150  
-                    <td class='context-item-name'>env</td>
151  
-                    <td class='context-item-value'>[RW]</td>
152  
-                    <td class='context-item-desc'></td>
153  
-                  </tr>
154  
-                  <tr class='top-aligned-row context-row'>
155  
-                    <td class='context-item-name'>errors</td>
156  
-                    <td class='context-item-value'>[R]</td>
157  
-                    <td class='context-item-desc'></td>
158  
-                  </tr>
159  
-                  <tr class='top-aligned-row context-row'>
160  
-                    <td class='context-item-name'>params</td>
161  
-                    <td class='context-item-value'>[RW]</td>
162  
-                    <td class='context-item-desc'></td>
163  
-                  </tr>
164  
-                  <tr class='top-aligned-row context-row'>
165  
-                    <td class='context-item-name'>request</td>
166  
-                    <td class='context-item-value'>[RW]</td>
167  
-                    <td class='context-item-desc'></td>
168  
-                  </tr>
169  
-                  <tr class='top-aligned-row context-row'>
170  
-                    <td class='context-item-name'>response</td>
171  
-                    <td class='context-item-value'>[RW]</td>
172  
-                    <td class='context-item-desc'></td>
173  
-                  </tr>
174  
-                  <tr class='top-aligned-row context-row'>
175  
-                    <td class='context-item-name'>routes</td>
176  
-                    <td class='context-item-value'>[R]</td>
177  
-                    <td class='context-item-desc'></td>
178  
-                  </tr>
179  
-                  <tr class='top-aligned-row context-row'>
180  
-                    <td class='context-item-name'>templates</td>
181  
-                    <td class='context-item-value'>[R]</td>
182  
-                    <td class='context-item-desc'></td>
183  
-                  </tr>
184  
-                </table>
185  
-              </div>
186  
-            </div>
187  
-            <div id='methods'>
188  
-              <h2>Public class methods</h2>
189  
-              <div class='method public-class' id='method-M000052'>
190  
-                <a name='M000052'></a>
191  
-                <div class='synopsis'>
192  
-                  <span class='name'>call</span>
193  
-                  <span class='arguments'>(env)</span>
194  
-                </div>
195  
-                <div class='source'>
196  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000052-source'); return false">
197  
-                    [show source]
198  
-                  </a>
199  
-                  <pre id='M000052-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 988</span>&#x000A;988:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)&#x000A;989:         <span class="ruby-identifier">synchronize</span> { <span class="ruby-identifier">prototype</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) }&#x000A;990:       <span class="ruby-keyword kw">end</span></pre>
200  
-                </div>
201  
-              </div>
202  
-              <div class='method public-class' id='method-M000053'>
203  
-                <a name='M000053'></a>
204  
-                <div class='synopsis'>
205  
-                  <span class='name'>caller_files</span>
206  
-                  <span class='arguments'>()</span>
207  
-                </div>
208  
-                <div class='description'>
209  
-                  <p>
210  
-                  Like Kernel#caller but excluding certain magic entries and without line /
211  
-                  method information; the resulting array contains filenames only.
212  
-                  </p>
213  
-                </div>
214  
-                <div class='source'>
215  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000053-source'); return false">
216  
-                    [show source]
217  
-                  </a>
218  
-                  <pre id='M000053-source'>      <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 1038</span>&#x000A;1038:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">caller_files</span>&#x000A;1039:         <span class="ruby-identifier">caller_locations</span>.&#x000A;1040:           <span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">file</span>,<span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span> }&#x000A;1041:       <span class="ruby-keyword kw">end</span></pre>
219  
-                </div>
220  
-              </div>
221  
-              <div class='method public-class' id='method-M000054'>
222  
-                <a name='M000054'></a>
223  
-                <div class='synopsis'>
224  
-                  <span class='name'>caller_locations</span>
225  
-                  <span class='arguments'>()</span>
226  
-                </div>
227  
-                <div class='source'>
228  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000054-source'); return false">
229  
-                    [show source]
230  
-                  </a>
231  
-                  <pre id='M000054-source'>      <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 1043</span>&#x000A;1043:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">caller_locations</span>&#x000A;1044:         <span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>).&#x000A;1045:           <span class="ruby-identifier">map</span>    { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/:(?=\d|in )/</span>)[<span class="ruby-value">0</span>,<span class="ruby-value">2</span>] }.&#x000A;1046:           <span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">file</span>,<span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-constant">CALLERS_TO_IGNORE</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">pattern</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">pattern</span> } }&#x000A;1047:       <span class="ruby-keyword kw">end</span></pre>
232  
-                </div>
233  
-              </div>
234  
-              <div class='method public-class' id='method-M000047'>
235  
-                <a name='M000047'></a>
236  
-                <div class='synopsis'>
237  
-                  <span class='name'>configure</span>
238  
-                  <span class='arguments'>(*envs) {|self if envs.empty? || envs.include?(environment.to_sym)| ...}</span>
239  
-                </div>
240  
-                <div class='description'>
241  
-                  <p>
242  
-                  Set configuration options for <a href="../Sinatra.html">Sinatra</a> and/or
243  
-                  the app. Allows scoping of settings for certain environments.
244  
-                  </p>
245  
-                </div>
246  
-                <div class='source'>
247  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000047-source'); return false">
248  
-                    [show source]
249  
-                  </a>
250  
-                  <pre id='M000047-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 938</span>&#x000A;938:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">envs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;939:         <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">envs</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">envs</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">environment</span>.<span class="ruby-identifier">to_sym</span>)&#x000A;940:       <span class="ruby-keyword kw">end</span></pre>
251  
-                </div>
252  
-              </div>
253  
-              <div class='method public-class' id='method-M000040'>
254  
-                <a name='M000040'></a>
255  
-                <div class='synopsis'>
256  
-                  <span class='name'>delete</span>
257  
-                  <span class='arguments'>(path, opts={}, &amp;bk)</span>
258  
-                </div>
259  
-                <div class='source'>
260  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000040-source'); return false">
261  
-                    [show source]
262  
-                  </a>
263  
-                  <pre id='M000040-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 856</span>&#x000A;856:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span>); <span class="ruby-identifier">route</span> <span class="ruby-value str">'DELETE'</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span> <span class="ruby-keyword kw">end</span></pre>
264  
-                </div>
265  
-              </div>
266  
-              <div class='method public-class' id='method-M000044'>
267  
-                <a name='M000044'></a>
268  
-                <div class='synopsis'>
269  
-                  <span class='name'>development?</span>
270  
-                  <span class='arguments'>()</span>
271  
-                </div>
272  
-                <div class='source'>
273  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000044-source'); return false">
274  
-                    [show source]
275  
-                  </a>
276  
-                  <pre id='M000044-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 932</span>&#x000A;932:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">development?</span>; <span class="ruby-identifier">environment</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:development</span> <span class="ruby-keyword kw">end</span></pre>
277  
-                </div>
278  
-              </div>
279  
-              <div class='method public-class' id='method-M000037'>
280  
-                <a name='M000037'></a>
281  
-                <div class='synopsis'>
282  
-                  <span class='name'>get</span>
283  
-                  <span class='arguments'>(path, opts={}, &amp;block)</span>
284  
-                </div>
285  
-                <div class='description'>
286  
-                  <p>
287  
-                  Defining a `GET` handler also automatically defines a `HEAD` handler.
288  
-                  </p>
289  
-                </div>
290  
-                <div class='source'>
291  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000037-source'); return false">
292  
-                    [show source]
293  
-                  </a>
294  
-                  <pre id='M000037-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 846</span>&#x000A;846:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;847:         <span class="ruby-identifier">conditions</span> = <span class="ruby-ivar">@conditions</span>.<span class="ruby-identifier">dup</span>&#x000A;848:         <span class="ruby-identifier">route</span>(<span class="ruby-value str">'GET'</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;849: &#x000A;850:         <span class="ruby-ivar">@conditions</span> = <span class="ruby-identifier">conditions</span>&#x000A;851:         <span class="ruby-identifier">route</span>(<span class="ruby-value str">'HEAD'</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;852:       <span class="ruby-keyword kw">end</span></pre>
295  
-                </div>
296  
-              </div>
297  
-              <div class='method public-class' id='method-M000041'>
298  
-                <a name='M000041'></a>
299  
-                <div class='synopsis'>
300  
-                  <span class='name'>head</span>
301  
-                  <span class='arguments'>(path, opts={}, &amp;bk)</span>
302  
-                </div>
303  
-                <div class='source'>
304  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000041-source'); return false">
305  
-                    [show source]
306  
-                  </a>
307  
-                  <pre id='M000041-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 857</span>&#x000A;857:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span>);   <span class="ruby-identifier">route</span> <span class="ruby-value str">'HEAD'</span>,   <span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span> <span class="ruby-keyword kw">end</span></pre>
308  
-                </div>
309  
-              </div>
310  
-              <div class='method public-class' id='method-M000042'>
311  
-                <a name='M000042'></a>
312  
-                <div class='synopsis'>
313  
-                  <span class='name'>helpers</span>
314  
-                  <span class='arguments'>(*extensions, &amp;block)</span>
315  
-                </div>
316  
-                <div class='description'>
317  
-                  <p>
318  
-                  Makes the methods defined in the block and in the Modules given in
319  
-                  `extensions` available to the handlers and templates
320  
-                  </p>
321  
-                </div>
322  
-                <div class='source'>
323  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000042-source'); return false">
324  
-                    [show source]
325  
-                  </a>
326  
-                  <pre id='M000042-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 918</span>&#x000A;918:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">helpers</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;919:         <span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>&#x000A;920:         <span class="ruby-identifier">include</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">extensions</span>.<span class="ruby-identifier">any?</span>&#x000A;921:       <span class="ruby-keyword kw">end</span></pre>
327  
-                </div>
328  
-              </div>
329  
-              <div class='method public-class' id='method-M000029'>
330  
-                <a name='M000029'></a>
331  
-                <div class='synopsis'>
332  
-                  <span class='name'>new</span>
333  
-                  <span class='arguments'>(app=nil) {|self if block_given?| ...}</span>
334  
-                </div>
335  
-                <div class='source'>
336  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000029-source'); return false">
337  
-                    [show source]
338  
-                  </a>
339  
-                  <pre id='M000029-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 391</span>&#x000A;391:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>=<span class="ruby-keyword kw">nil</span>)&#x000A;392:       <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>&#x000A;393:       <span class="ruby-ivar">@template_cache</span> = <span class="ruby-constant">Tilt</span><span class="ruby-operator">::</span><span class="ruby-constant">Cache</span>.<span class="ruby-identifier">new</span>&#x000A;394:       <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>&#x000A;395:     <span class="ruby-keyword kw">end</span></pre>
340  
-                </div>
341  
-              </div>
342  
-              <div class='method public-class' id='method-M000051'>
343  
-                <a name='M000051'></a>
344  
-                <div class='synopsis'>
345  
-                  <span class='name'>new</span>
346  
-                  <span class='arguments'>(*args, &amp;bk)</span>
347  
-                </div>
348  
-                <div class='description'>
349  
-                  <p>
350  
-                  Create a new instance of the class fronted by its middleware pipeline. The
351  
-                  object is guaranteed to respond to <a href="Base.html#M000030">call</a> but
352  
-                  may not be an instance of the class new was called on.
353  
-                  </p>
354  
-                </div>
355  
-                <div class='source'>
356  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000051-source'); return false">
357  
-                    [show source]
358  
-                  </a>
359  
-                  <pre id='M000051-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 976</span>&#x000A;976:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span>)&#x000A;977:         <span class="ruby-identifier">builder</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Builder</span>.<span class="ruby-identifier">new</span>&#x000A;978:         <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">use</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span><span class="ruby-operator">::</span><span class="ruby-constant">Cookie</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sessions?</span>&#x000A;979:         <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">use</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">CommonLogger</span>    <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">logging?</span>&#x000A;980:         <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">use</span> <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">MethodOverride</span>  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method_override?</span>&#x000A;981:         <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">use</span> <span class="ruby-constant">ShowExceptions</span>        <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">show_exceptions?</span>&#x000A;982:         <span class="ruby-identifier">middleware</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span>,<span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">use</span>(<span class="ruby-identifier">c</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>) }&#x000A;983: &#x000A;984:         <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">run</span> <span class="ruby-keyword kw">super</span>&#x000A;985:         <span class="ruby-identifier">builder</span>.<span class="ruby-identifier">to_app</span>&#x000A;986:       <span class="ruby-keyword kw">end</span></pre>
360  
-                </div>
361  
-              </div>
362  
-              <div class='method public-class' id='method-M000039'>
363  
-                <a name='M000039'></a>
364  
-                <div class='synopsis'>
365  
-                  <span class='name'>post</span>
366  
-                  <span class='arguments'>(path, opts={}, &amp;bk)</span>
367  
-                </div>
368  
-                <div class='source'>
369  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000039-source'); return false">
370  
-                    [show source]
371  
-                  </a>
372  
-                  <pre id='M000039-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 855</span>&#x000A;855:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span>);   <span class="ruby-identifier">route</span> <span class="ruby-value str">'POST'</span>,   <span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span> <span class="ruby-keyword kw">end</span></pre>
373  
-                </div>
374  
-              </div>
375  
-              <div class='method public-class' id='method-M000045'>
376  
-                <a name='M000045'></a>
377  
-                <div class='synopsis'>
378  
-                  <span class='name'>production?</span>
379  
-                  <span class='arguments'>()</span>
380  
-                </div>
381  
-                <div class='source'>
382  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000045-source'); return false">
383  
-                    [show source]
384  
-                  </a>
385  
-                  <pre id='M000045-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 933</span>&#x000A;933:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">production?</span>;  <span class="ruby-identifier">environment</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:production</span>  <span class="ruby-keyword kw">end</span></pre>
386  
-                </div>
387  
-              </div>
388  
-              <div class='method public-class' id='method-M000050'>
389  
-                <a name='M000050'></a>
390  
-                <div class='synopsis'>
391  
-                  <span class='name'>prototype</span>
392  
-                  <span class='arguments'>()</span>
393  
-                </div>
394  
-                <div class='description'>
395  
-                  <p>
396  
-                  The prototype instance used to process requests.
397  
-                  </p>
398  
-                </div>
399  
-                <div class='source'>
400  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000050-source'); return false">
401  
-                    [show source]
402  
-                  </a>
403  
-                  <pre id='M000050-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 969</span>&#x000A;969:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prototype</span>&#x000A;970:         <span class="ruby-ivar">@prototype</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">new</span>&#x000A;971:       <span class="ruby-keyword kw">end</span></pre>
404  
-                </div>
405  
-              </div>
406  
-              <div class='method public-class' id='method-M000038'>
407  
-                <a name='M000038'></a>
408  
-                <div class='synopsis'>
409  
-                  <span class='name'>put</span>
410  
-                  <span class='arguments'>(path, opts={}, &amp;bk)</span>
411  
-                </div>
412  
-                <div class='source'>
413  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000038-source'); return false">
414  
-                    [show source]
415  
-                  </a>
416  
-                  <pre id='M000038-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 854</span>&#x000A;854:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span>);    <span class="ruby-identifier">route</span> <span class="ruby-value str">'PUT'</span>,    <span class="ruby-identifier">path</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">bk</span> <span class="ruby-keyword kw">end</span></pre>
417  
-                </div>
418  
-              </div>
419  
-              <div class='method public-class' id='method-M000043'>
420  
-                <a name='M000043'></a>
421  
-                <div class='synopsis'>
422  
-                  <span class='name'>register</span>
423  
-                  <span class='arguments'>(*extensions, &amp;block)</span>
424  
-                </div>
425  
-                <div class='source'>
426  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000043-source'); return false">
427  
-                    [show source]
428  
-                  </a>
429  
-                  <pre id='M000043-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 923</span>&#x000A;923:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">extensions</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;924:         <span class="ruby-identifier">extensions</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Module</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>&#x000A;925:         <span class="ruby-ivar">@extensions</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">extensions</span>&#x000A;926:         <span class="ruby-identifier">extensions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">extension</span><span class="ruby-operator">|</span>&#x000A;927:           <span class="ruby-identifier">extend</span> <span class="ruby-identifier">extension</span>&#x000A;928:           <span class="ruby-identifier">extension</span>.<span class="ruby-identifier">registered</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">extension</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:registered</span>)&#x000A;929:         <span class="ruby-keyword kw">end</span>&#x000A;930:       <span class="ruby-keyword kw">end</span></pre>
430  
-                </div>
431  
-              </div>
432  
-              <div class='method public-class' id='method-M000049'>
433  
-                <a name='M000049'></a>
434  
-                <div class='synopsis'>
435  
-                  <span class='name'>run!</span>
436  
-                  <span class='arguments'>(options={})</span>
437  
-                </div>
438  
-                <div class='description'>
439  
-                  <p>
440  
-                  Run the <a href="../Sinatra.html">Sinatra</a> app as a self-hosted server
441  
-                  using Thin, Mongrel or WEBrick (in that order)
442  
-                  </p>
443  
-                </div>
444  
-                <div class='source'>
445  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000049-source'); return false">
446  
-                    [show source]
447  
-                  </a>
448  
-                  <pre id='M000049-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 950</span>&#x000A;950:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run!</span>(<span class="ruby-identifier">options</span>={})&#x000A;951:         <span class="ruby-identifier">set</span> <span class="ruby-identifier">options</span>&#x000A;952:         <span class="ruby-identifier">handler</span>      = <span class="ruby-identifier">detect_rack_handler</span>&#x000A;953:         <span class="ruby-identifier">handler_name</span> = <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/.*::/</span>, <span class="ruby-value str">''</span>)&#x000A;954:         <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;== Sinatra/#{Sinatra::VERSION} has taken the stage &quot;</span> <span class="ruby-operator">+</span>&#x000A;955:           <span class="ruby-node">&quot;on #{port} for #{environment} with backup from #{handler_name}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">handler_name</span> <span class="ruby-operator">=~</span><span class="ruby-regexp re">/cgi/i</span>&#x000A;956:         <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">run</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">:Host</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">bind</span>, <span class="ruby-identifier">:Port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">port</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">server</span><span class="ruby-operator">|</span>&#x000A;957:           <span class="ruby-identifier">trap</span>(<span class="ruby-identifier">:INT</span>) <span class="ruby-keyword kw">do</span>&#x000A;958:             <span class="ruby-comment cmt">## Use thins' hard #stop! if available, otherwise just #stop</span>&#x000A;959:             <span class="ruby-identifier">server</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:stop!</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">stop!</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">server</span>.<span class="ruby-identifier">stop</span>&#x000A;960:             <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\n== Sinatra has ended his set (crowd applauds)&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">handler_name</span> <span class="ruby-operator">=~</span><span class="ruby-regexp re">/cgi/i</span>&#x000A;961:           <span class="ruby-keyword kw">end</span>&#x000A;962:           <span class="ruby-identifier">set</span> <span class="ruby-identifier">:running</span>, <span class="ruby-keyword kw">true</span>&#x000A;963:         <span class="ruby-keyword kw">end</span>&#x000A;964:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EADDRINUSE</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>&#x000A;965:         <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;== Someone is already performing on port #{port}!&quot;</span>&#x000A;966:       <span class="ruby-keyword kw">end</span></pre>
449  
-                </div>
450  
-              </div>
451  
-              <div class='method public-class' id='method-M000046'>
452  
-                <a name='M000046'></a>
453  
-                <div class='synopsis'>
454  
-                  <span class='name'>test?</span>
455  
-                  <span class='arguments'>()</span>
456  
-                </div>
457  
-                <div class='source'>
458  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000046-source'); return false">
459  
-                    [show source]
460  
-                  </a>
461  
-                  <pre id='M000046-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 934</span>&#x000A;934:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test?</span>;        <span class="ruby-identifier">environment</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:test</span>        <span class="ruby-keyword kw">end</span></pre>
462  
-                </div>
463  
-              </div>
464  
-              <div class='method public-class' id='method-M000048'>
465  
-                <a name='M000048'></a>
466  
-                <div class='synopsis'>
467  
-                  <span class='name'>use</span>
468  
-                  <span class='arguments'>(middleware, *args, &amp;block)</span>
469  
-                </div>
470  
-                <div class='description'>
471  
-                  <p>
472  
-                  Use the specified Rack middleware
473  
-                  </p>
474  
-                </div>
475  
-                <div class='source'>
476  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000048-source'); return false">
477  
-                    [show source]
478  
-                  </a>
479  
-                  <pre id='M000048-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 943</span>&#x000A;943:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">use</span>(<span class="ruby-identifier">middleware</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;944:         <span class="ruby-ivar">@prototype</span> = <span class="ruby-keyword kw">nil</span>&#x000A;945:         <span class="ruby-ivar">@middleware</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">middleware</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>]&#x000A;946:       <span class="ruby-keyword kw">end</span></pre>
480  
-                </div>
481  
-              </div>
482  
-              <h2>Public instance methods</h2>
483  
-              <div class='method public-instance' id='method-M000030'>
484  
-                <a name='M000030'></a>
485  
-                <div class='synopsis'>
486  
-                  <span class='name'>call</span>
487  
-                  <span class='arguments'>(env)</span>
488  
-                </div>
489  
-                <div class='description'>
490  
-                  <p>
491  
-                  Rack call interface.
492  
-                  </p>
493  
-                </div>
494  
-                <div class='source'>
495  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000030-source'); return false">
496  
-                    [show source]
497  
-                  </a>
498  
-                  <pre id='M000030-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 398</span>&#x000A;398:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)&#x000A;399:       <span class="ruby-identifier">dup</span>.<span class="ruby-identifier">call!</span>(<span class="ruby-identifier">env</span>)&#x000A;400:     <span class="ruby-keyword kw">end</span></pre>
499  
-                </div>
500  
-              </div>
501  
-              <div class='method public-instance' id='method-M000031'>
502  
-                <a name='M000031'></a>
503  
-                <div class='synopsis'>
504  
-                  <span class='name'>call!</span>
505  
-                  <span class='arguments'>(env)</span>
506  
-                </div>
507  
-                <div class='source'>
508  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000031-source'); return false">
509  
-                    [show source]
510  
-                  </a>
511  
-                  <pre id='M000031-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 404</span>&#x000A;404:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call!</span>(<span class="ruby-identifier">env</span>)&#x000A;405:       <span class="ruby-ivar">@env</span>      = <span class="ruby-identifier">env</span>&#x000A;406:       <span class="ruby-ivar">@request</span>  = <span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>)&#x000A;407:       <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>&#x000A;408:       <span class="ruby-ivar">@params</span>   = <span class="ruby-identifier">indifferent_params</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">params</span>)&#x000A;409:       <span class="ruby-ivar">@template_cache</span>.<span class="ruby-identifier">clear</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">settings</span>.<span class="ruby-identifier">reload_templates</span>&#x000A;410: &#x000A;411:       <span class="ruby-identifier">invoke</span> { <span class="ruby-identifier">dispatch!</span> }&#x000A;412:       <span class="ruby-identifier">invoke</span> { <span class="ruby-identifier">error_block!</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span>) }&#x000A;413: &#x000A;414:       <span class="ruby-identifier">status</span>, <span class="ruby-identifier">header</span>, <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">finish</span>&#x000A;415: &#x000A;416:       <span class="ruby-comment cmt"># Never produce a body on HEAD requests. Do retain the Content-Length</span>&#x000A;417:       <span class="ruby-comment cmt"># unless it's &quot;0&quot;, in which case we assume it was calculated erroneously</span>&#x000A;418:       <span class="ruby-comment cmt"># for a manual HEAD response and remove it entirely.</span>&#x000A;419:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'REQUEST_METHOD'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'HEAD'</span>&#x000A;420:         <span class="ruby-identifier">body</span> = []&#x000A;421:         <span class="ruby-identifier">header</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'Content-Length'</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">header</span>[<span class="ruby-value str">'Content-Length'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'0'</span>&#x000A;422:       <span class="ruby-keyword kw">end</span>&#x000A;423: &#x000A;424:       [<span class="ruby-identifier">status</span>, <span class="ruby-identifier">header</span>, <span class="ruby-identifier">body</span>]&#x000A;425:     <span class="ruby-keyword kw">end</span></pre>
512  
-                </div>
513  
-              </div>
514  
-              <div class='method public-instance' id='method-M000036'>
515  
-                <a name='M000036'></a>
516  
-                <div class='synopsis'>
517  
-                  <span class='name'>forward</span>
518  
-                  <span class='arguments'>()</span>
519  
-                </div>
520  
-                <div class='description'>
521  
-                  <p>
522  
-                  Forward the request to the downstream app &#8212; middleware only.
523  
-                  </p>
524  
-                </div>
525  
-                <div class='source'>
526  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000036-source'); return false">
527  
-                    [show source]
528  
-                  </a>
529  
-                  <pre id='M000036-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 448</span>&#x000A;448:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">forward</span>&#x000A;449:       <span class="ruby-identifier">fail</span> <span class="ruby-value str">&quot;downstream app not set&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:call</span>&#x000A;450:       <span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">env</span>)&#x000A;451:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">status</span> = <span class="ruby-identifier">status</span>&#x000A;452:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">body</span>&#x000A;453:       <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">headers</span>&#x000A;454:       <span class="ruby-keyword kw">nil</span>&#x000A;455:     <span class="ruby-keyword kw">end</span></pre>
530  
-                </div>
531  
-              </div>
532  
-              <div class='method public-instance' id='method-M000034'>
533  
-                <a name='M000034'></a>
534  
-                <div class='synopsis'>
535  
-                  <span class='name'>halt</span>
536  
-                  <span class='arguments'>(*response)</span>
537  
-                </div>
538  
-                <div class='description'>
539  
-                  <p>
540  
-                  Exit the current block, halts any further processing of the request, and
541  
-                  returns the specified response.
542  
-                  </p>
543  
-                </div>
544  
-                <div class='source'>
545  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000034-source'); return false">
546  
-                    [show source]
547  
-                  </a>
548  
-                  <pre id='M000034-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 435</span>&#x000A;435:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">halt</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">response</span>)&#x000A;436:       <span class="ruby-identifier">response</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">first</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>&#x000A;437:       <span class="ruby-identifier">throw</span> <span class="ruby-identifier">:halt</span>, <span class="ruby-identifier">response</span>&#x000A;438:     <span class="ruby-keyword kw">end</span></pre>
549  
-                </div>
550  
-              </div>
551  
-              <div class='method public-instance' id='method-M000033'>
552  
-                <a name='M000033'></a>
553  
-                <div class='synopsis'>
554  
-                  <span class='name'>options</span>
555  
-                  <span class='arguments'>()</span>
556  
-                </div>
557  
-                <div class='description'>
558  
-                  <p>
559  
-                  Alias for <a href="Base.html#M000032">settings</a>
560  
-                  </p>
561  
-                </div>
562  
-              </div>
563  
-              <div class='method public-instance' id='method-M000035'>
564  
-                <a name='M000035'></a>
565  
-                <div class='synopsis'>
566  
-                  <span class='name'>pass</span>
567  
-                  <span class='arguments'>(&amp;block)</span>
568  
-                </div>
569  
-                <div class='description'>
570  
-                  <p>
571  
-                  Pass control to the next matching route. If there are no more matching
572  
-                  routes, <a href="../Sinatra.html">Sinatra</a> will return a 404 response.
573  
-                  </p>
574  
-                </div>
575  
-                <div class='source'>
576  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000035-source'); return false">
577  
-                    [show source]
578  
-                  </a>
579  
-                  <pre id='M000035-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 443</span>&#x000A;443:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pass</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;444:       <span class="ruby-identifier">throw</span> <span class="ruby-identifier">:pass</span>, <span class="ruby-identifier">block</span>&#x000A;445:     <span class="ruby-keyword kw">end</span></pre>
580  
-                </div>
581  
-              </div>
582  
-              <div class='method public-instance' id='method-M000032'>
583  
-                <a name='M000032'></a>
584  
-                <div class='synopsis'>
585  
-                  <span class='name'>settings</span>
586  
-                  <span class='arguments'>()</span>
587  
-                </div>
588  
-                <div class='description'>
589  
-                  <p>
590  
-                  Access settings defined with Base.set.
591  
-                  </p>
592  
-                </div>
593  
-                <div class='source'>
594  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000032-source'); return false">
595  
-                    [show source]
596  
-                  </a>
597  
-                  <pre id='M000032-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 428</span>&#x000A;428:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">settings</span>&#x000A;429:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>&#x000A;430:     <span class="ruby-keyword kw">end</span></pre>
598  
-                </div>
599  
-              </div>
600  
-            </div>
601  
-          </div>
602  
-        </div>
603  
-      </div>
604  
-      <div id='footer-push'></div>
605  
-    </div>
606  
-    <div id='footer'>
607  
-      <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
608  
-    </div>
609  
-  </body>
610  
-</html>
401  api/classes/Sinatra/Helpers.html
... ...
@@ -1,401 +0,0 @@
1  
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2  
-<html lang='en'>
3  
-  <head>
4  
-    <title>: Sinatra::Helpers [Sinatra API Documentation]</title>
5  
-    <meta content='text/html; charset=utf8' http-equiv='Content-Type'>
6  
-    <link href='../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7  
-    <script type='text/javascript'>
8  
-      //<![CDATA[
9  
-        function popupCode(url) {
10  
-          window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11  
-        }
12  
-        
13  
-        function toggleCode(id) {
14  
-          var code = document.getElementById(id)
15  
-        
16  
-          code.style.display = code.style.display != 'block' ? 'block' : 'none'
17  
-          return true
18  
-        }
19  
-        
20  
-        // Make codeblocks hidden by default
21  
-        document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22  
-      //]]>
23  
-    </script>
24  
-  </head>
25  
-  <body class='page'>
26  
-    <div class='class' id='wrapper'>
27  
-      <div class='header'>
28  
-        <h1 class='name'>
29  
-          <span class='type'>Module</span>
30  
-          Sinatra::Helpers
31  
-        </h1>
32  
-        <ol class='paths'>
33  
-          <li>
34  
-            <a href="../../files/lib/sinatra/base_rb.html">lib/sinatra/base.rb</a>
35  
-          </li>
36  
-        </ol>
37  
-      </div>
38  
-      <div id='content'>
39  
-        <div id='text'>
40  
-          <div id='description'>
41  
-            <p>
42  
-            Methods available to routes, before/after filters, and views.
43  
-            </p>
44  
-          </div>
45  
-          <div id='method-list'>
46  
-            <h2>Methods</h2>
47  
-            <h3>public instance</h3>
48  
-            <ol>
49  
-              <li><a href="#M000019">attachment</a></li>
50  
-              <li><a href="#M000025">back</a></li>
51  
-              <li><a href="#M000011">body</a></li>
52  
-              <li><a href="#M000021">cache_control</a></li>
53  
-              <li><a href="#M000018">content_type</a></li>
54  
-              <li><a href="#M000013">error</a></li>
55  
-              <li><a href="#M000024">etag</a></li>
56  
-              <li><a href="#M000022">expires</a></li>
57  
-              <li><a href="#M000015">headers</a></li>
58  
-              <li><a href="#M000023">last_modified</a></li>
59  
-              <li><a href="#M000017">mime_type</a></li>
60  
-              <li><a href="#M000014">not_found</a></li>
61  
-              <li><a href="#M000012">redirect</a></li>
62  
-              <li><a href="#M000020">send_file</a></li>
63  
-              <li><a href="#M000016">session</a></li>
64  
-              <li><a href="#M000010">status</a></li>
65  
-            </ol>
66  
-          </div>
67  
-          <div id='section'>
68  
-            <div id='methods'>
69  
-              <h2>Public instance methods</h2>
70  
-              <div class='method public-instance' id='method-M000019'>
71  
-                <a name='M000019'></a>
72  
-                <div class='synopsis'>
73  
-                  <span class='name'>attachment</span>
74  
-                  <span class='arguments'>(filename=nil)</span>
75  
-                </div>
76  
-                <div class='description'>
77  
-                  <p>
78  
-                  Set the Content-Disposition to &#8220;attachment&#8221; with the specified
79  
-                  filename, instructing the user agents to prompt to save.
80  
-                  </p>
81  
-                </div>
82  
-                <div class='source'>
83  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000019-source'); return false">
84  
-                    [show source]
85  
-                  </a>
86  
-                  <pre id='M000019-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 147</span>&#x000A;147:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attachment</span>(<span class="ruby-identifier">filename</span>=<span class="ruby-keyword kw">nil</span>)&#x000A;148:       <span class="ruby-identifier">response</span>[<span class="ruby-value str">'Content-Disposition'</span>] = <span class="ruby-value str">'attachment'</span>&#x000A;149:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span>&#x000A;150:         <span class="ruby-identifier">params</span> = <span class="ruby-value str">'; filename=&quot;%s&quot;'</span> <span class="ruby-operator">%</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">filename</span>)&#x000A;151:         <span class="ruby-identifier">response</span>[<span class="ruby-value str">'Content-Disposition'</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">params</span>&#x000A;152:       <span class="ruby-keyword kw">end</span>&#x000A;153:     <span class="ruby-keyword kw">end</span></pre>
87  
-                </div>
88  
-              </div>
89  
-              <div class='method public-instance' id='method-M000025'>
90  
-                <a name='M000025'></a>
91  
-                <div class='synopsis'>
92  
-                  <span class='name'>back</span>
93  
-                  <span class='arguments'>()</span>
94  
-                </div>
95  
-                <div class='description'>
96  
-                  <p>
97  
-                  Sugar for redirect (example: redirect back)
98  
-                  </p>
99  
-                </div>
100  
-                <div class='source'>
101  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000025-source'); return false">
102  
-                    [show source]
103  
-                  </a>
104  
-                  <pre id='M000025-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 280</span>&#x000A;280:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">back</span> ; <span class="ruby-identifier">request</span>.<span class="ruby-identifier">referer</span> ; <span class="ruby-keyword kw">end</span></pre>
105  
-                </div>
106  
-              </div>
107  
-              <div class='method public-instance' id='method-M000011'>
108  
-                <a name='M000011'></a>
109  
-                <div class='synopsis'>
110  
-                  <span class='name'>body</span>
111  
-                  <span class='arguments'>(value=nil, &amp;block)</span>
112  
-                </div>
113  
-                <div class='description'>
114  
-                  <p>
115  
-                  Set or retrieve the response body. When a block is given, evaluation is
116  
-                  deferred until the body is read with each.
117  
-                  </p>
118  
-                </div>
119  
-                <div class='source'>
120  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000011-source'); return false">
121  
-                    [show source]
122  
-                  </a>
123  
-                  <pre id='M000011-source'>    <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 88</span>&#x000A;88:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">body</span>(<span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;89:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>&#x000A;90:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">each</span> ; <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">call</span> ; <span class="ruby-keyword kw">end</span>&#x000A;91:         <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">block</span>&#x000A;92:       <span class="ruby-keyword kw">else</span>&#x000A;93:         <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">value</span>&#x000A;94:       <span class="ruby-keyword kw">end</span>&#x000A;95:     <span class="ruby-keyword kw">end</span></pre>
124  
-                </div>
125  
-              </div>
126  
-              <div class='method public-instance' id='method-M000021'>
127  
-                <a name='M000021'></a>
128  
-                <div class='synopsis'>
129  
-                  <span class='name'>cache_control</span>
130  
-                  <span class='arguments'>(*values)</span>
131  
-                </div>
132  
-                <div class='description'>
133  
-                  <p>
134  
-                  Specify response freshness policy for HTTP caches (Cache-Control header).
135  
-                  Any number of non-value directives (:public, :private, :no_cache,
136  
-                  :no_store, :must_revalidate, :proxy_revalidate) may be passed along with a
137  
-                  Hash of value directives (:max_age, :min_stale, :s_max_age).
138  
-                  </p>
139  
-                  <pre>cache_control :public, :must_revalidate, :max_age =&gt; 60&#x000A;=&gt; Cache-Control: public, must-revalidate, max-age=60</pre>
140  
-                  <p>
141  
-                  See RFC 2616 / 14.9 for more on standard cache control directives: <a
142  
-                  href="http://tools.ietf.org/html/rfc2616#section-14.9.1">tools.ietf.org/html/rfc2616#section-14.9.1</a>
143  
-                  </p>
144  
-                </div>
145  
-                <div class='source'>
146  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000021-source'); return false">
147  
-                    [show source]
148  
-                  </a>
149  
-                  <pre id='M000021-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 200</span>&#x000A;200:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_control</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">values</span>)&#x000A;201:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Hash</span>)&#x000A;202:         <span class="ruby-identifier">hash</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">pop</span>&#x000A;203:         <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> }&#x000A;204:         <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">k</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> }&#x000A;205:       <span class="ruby-keyword kw">else</span>&#x000A;206:         <span class="ruby-identifier">hash</span> = {}&#x000A;207:       <span class="ruby-keyword kw">end</span>&#x000A;208: &#x000A;209:       <span class="ruby-identifier">values</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">'_'</span>,<span class="ruby-value str">'-'</span>) }&#x000A;210:       <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">values</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">'_'</span>, <span class="ruby-value str">'-'</span>), <span class="ruby-identifier">v</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">'='</span>) }&#x000A;211: &#x000A;212:       <span class="ruby-identifier">response</span>[<span class="ruby-value str">'Cache-Control'</span>] = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">any?</span>&#x000A;213:     <span class="ruby-keyword kw">end</span></pre>
150  
-                </div>
151  
-              </div>
152  
-              <div class='method public-instance' id='method-M000018'>
153  
-                <a name='M000018'></a>
154  
-                <div class='synopsis'>
155  
-                  <span class='name'>content_type</span>
156  
-                  <span class='arguments'>(type, params={})</span>
157  
-                </div>
158  
-                <div class='description'>
159  
-                  <p>
160  
-                  Set the Content-Type of the response body given a media type or file
161  
-                  extension.
162  
-                  </p>
163  
-                </div>
164  
-                <div class='source'>
165  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000018-source'); return false">
166  
-                    [show source]
167  
-                  </a>
168  
-                  <pre id='M000018-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 134</span>&#x000A;134:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_type</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">params</span>={})&#x000A;135:       <span class="ruby-identifier">mime_type</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">mime_type</span>(<span class="ruby-identifier">type</span>)&#x000A;136:       <span class="ruby-identifier">fail</span> <span class="ruby-value str">&quot;Unknown media type: %p&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">type</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mime_type</span>.<span class="ruby-identifier">nil?</span>&#x000A;137:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">any?</span>&#x000A;138:         <span class="ruby-identifier">params</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">kv</span><span class="ruby-operator">|</span> <span class="ruby-value str">&quot;%s=%s&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">kv</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)&#x000A;139:         <span class="ruby-identifier">response</span>[<span class="ruby-value str">'Content-Type'</span>] = [<span class="ruby-identifier">mime_type</span>, <span class="ruby-identifier">params</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;;&quot;</span>)&#x000A;140:       <span class="ruby-keyword kw">else</span>&#x000A;141:         <span class="ruby-identifier">response</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-identifier">mime_type</span>&#x000A;142:       <span class="ruby-keyword kw">end</span>&#x000A;143:     <span class="ruby-keyword kw">end</span></pre>
169  
-                </div>
170  
-              </div>
171  
-              <div class='method public-instance' id='method-M000013'>
172  
-                <a name='M000013'></a>
173  
-                <div class='synopsis'>
174  
-                  <span class='name'>error</span>
175  
-                  <span class='arguments'>(code, body=nil)</span>
176  
-                </div>
177  
-                <div class='description'>
178  
-                  <p>
179  
-                  Halt processing and return the error status provided.
180  
-                  </p>
181  
-                </div>
182  
-                <div class='source'>
183  
-                  <a class='source-toggle' href='#' onclick="toggleCode('M000013-source'); return false">
184  
-                    [show source]
185  
-                  </a>
186  
-                  <pre id='M000013-source'>     <span class="ruby-comment cmt"># File lib/sinatra/base.rb, line 105</span>&#x000A;105:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">body</span>=<span class="ruby-keyword kw">nil</span>)&#x000A;106:       <span class="ruby-identifier">code</span>, <span class="ruby-identifier">body</span>    = <span class="ruby-value">500</span>, <span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_str</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:to_str</span>&#x000A;107:       <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span> = <span class="ruby-identifier">body</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">nil?</span>&#x000A;108:       <span class="ruby-identifier">halt</span> <span class="ruby-identifier">code</span>&#x000A;109:     <span class="ruby-keyword kw">end</span></pre>
187  
-                </div>
188  
-              </div>
189  
-              <div class='method public-instance' id='method-M000024'>
190  
-                <a name='M000024'></a>
191  
-                <div class='synopsis'>
192  
-                  <span class='name'>etag</span>
193  
-                  <span class='arguments'>(value, kind=:strong)</span>
194  
-                </div>
195  
-                <div class='description'>
196  
-                  <p>
197  
-                  Set the response entity tag (HTTP &#8216;ETag&#8217; header) and halt if
198  
-                  conditional GET matches. The <tt>value</tt> argument is an identifier that
199  
-                  uniquely identifies the current version of the resource. The <tt>kind</tt>
200  
-                  argument indicates whether the etag should be used as a :strong (default)
201  
-                  or :weak cache validator.
202  
-                  </p>
203  
-                  <p>
204  
-                  When the current request includes an &#8216;If-None-Match&#8217; header