Skip to content
This repository
Newer
Older
100644 938 lines (640 sloc) 23.944 kb
df800b5c »
2008-03-24 Docs are started
1 = Sinatra
2
4c91e540 »
2009-04-20 Web applications should not be hyphenated
3 Sinatra is a DSL for quickly creating web applications in Ruby with minimal
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
4 effort:
df800b5c »
2008-03-24 Docs are started
5
6 # myapp.rb
7 require 'sinatra'
c37db5cd »
2010-09-07 minor adjustments and fixes for the readme examples
8
df800b5c »
2008-03-24 Docs are started
9 get '/' do
10 'Hello world!'
11 end
12
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
13 Install the gem and run with:
df800b5c »
2008-03-24 Docs are started
14
8465d492 »
2010-09-07 Avoid `require "rubygems"` and `sudo` in README.
15 gem install sinatra
16 ruby -rubygems myapp.rb
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
17
18 View at: http://localhost:4567
19
20 == Routes
21
22 In Sinatra, a route is an HTTP method paired with an URL matching pattern.
23 Each route is associated with a block:
df800b5c »
2008-03-24 Docs are started
24
25 get '/' do
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
26 .. show something ..
df800b5c »
2008-03-24 Docs are started
27 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
28
df800b5c »
2008-03-24 Docs are started
29 post '/' do
30 .. create something ..
31 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
32
df800b5c »
2008-03-24 Docs are started
33 put '/' do
34 .. update something ..
35 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
36
df800b5c »
2008-03-24 Docs are started
37 delete '/' do
38 .. annihilate something ..
39 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
40
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
41 Routes are matched in the order they are defined. The first route that
f44fb6aa »
2008-08-31 grammar/formatting pass over README
42 matches the request is invoked.
1776a80d »
2008-03-24 Added Version and Docs
43
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
44 Route patterns may include named parameters, accessible via the
45 <tt>params</tt> hash:
1776a80d »
2008-03-24 Added Version and Docs
46
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
47 get '/hello/:name' do
ce0fe87a »
2009-05-20 fix inaccurate comment in README
48 # matches "GET /hello/foo" and "GET /hello/bar"
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
49 # params[:name] is 'foo' or 'bar'
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
50 "Hello #{params[:name]}!"
1776a80d »
2008-03-24 Added Version and Docs
51 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
52
6569d1b0 »
2009-01-28 Added route block params in routing statements [#140]
53 You can also access named parameters via block parameters:
54
55 get '/hello/:name' do |n|
56 "Hello #{n}!"
57 end
58
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
59 Route patterns may also include splat (or wildcard) parameters, accessible
60 via the <tt>params[:splat]</tt> array.
1776a80d »
2008-03-24 Added Version and Docs
61
9c85e99c »
2008-04-24 Specs, documentation and fixes for splat'n routes
62 get '/say/*/to/*' do
63 # matches /say/hello/to/world
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
64 params[:splat] # => ["hello", "world"]
9c85e99c »
2008-04-24 Specs, documentation and fixes for splat'n routes
65 end
66
67 get '/download/*.*' do
68 # matches /download/path/to/file.xml
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
69 params[:splat] # => ["path/to/file", "xml"]
1776a80d »
2008-03-24 Added Version and Docs
70 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
71
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
72 Route matching with Regular Expressions:
73
74 get %r{/hello/([\w]+)} do
75 "Hello, #{params[:captures].first}!"
76 end
77
6569d1b0 »
2009-01-28 Added route block params in routing statements [#140]
78 Or with a block parameter:
79
80 get %r{/hello/([\w]+)} do |c|
81 "Hello, #{c}!"
82 end
83
726feeb4 »
2010-09-02 Documentation for condition. Fixes GH #15.
84 === Conditions
85
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
86 Routes may include a variety of matching conditions, such as the user agent:
f44fb6aa »
2008-08-31 grammar/formatting pass over README
87
1776a80d »
2008-03-24 Added Version and Docs
88 get '/foo', :agent => /Songbird (\d\.\d)[\d\/]*?/ do
89 "You're using Songbird version #{params[:agent][0]}"
90 end
91
92 get '/foo' do
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
93 # Matches non-songbird browsers
1776a80d »
2008-03-24 Added Version and Docs
94 end
df800b5c »
2008-03-24 Docs are started
95
fa527095 »
2010-09-03 fix markup for inline code in README
96 Other available conditions are +host_name+ and +provides+:
726feeb4 »
2010-09-02 Documentation for condition. Fixes GH #15.
97
98 get '/', :host_name => /^admin\./ do
99 "Admin Area, Access denied!"
100 end
101
102 get '/', :provides => 'html' do
103 haml :index
104 end
105
106 get '/', :provides => ['rss', 'atom', 'xml'] do
107 builder :feed
108 end
109
110 You can easily define your own conditions:
111
112 set(:probability) { |value| condition { rand <= value } }
113
114 get '/win_a_car', :probability => 0.1 do
115 "You won!"
116 end
117
118 get '/win_a_car' do
119 "Sorry, you lost."
120 end
121
aaeb564a »
2010-09-02 document route return values, fixes GH #23
122 === Return values
123
124 The return value of a route block determines at least the response body passed
125 on to the HTTP client, or at least the next middleware in the Rack stack.
126 Most commonly this is a string, as in the above examples. But other values are
127 also accepted.
128
c6d06148 »
2010-09-10 Minor README improvements.
129 You can return any object that would either be a valid Rack response, Rack
130 body object or HTTP status code:
aaeb564a »
2010-09-02 document route return values, fixes GH #23
131
626f6890 »
2010-09-03 fix markup for multi word inline code in README
132 * An Array with three elements: <tt>[status (Fixnum), headers (Hash), response body (responds to #each)]</tt>
133 * An Array with two elements: <tt>[status (Fixnum), response body (responds to #each)]</tt>
9c73cf7d »
2010-09-03 fix markup for multi word inline code in README, take two (apparently…
134 * An object that responds to <tt>#each</tt> and passes nothing but strings to the given block
aaeb564a »
2010-09-02 document route return values, fixes GH #23
135 * A Fixnum representing the status code
136
137 That way we can for instance easily implement a streaming example:
138
139 class Stream
140 def each
141 100.times { |i| yield "#{i}\n" }
142 end
143 end
144
8fbd9c21 »
2010-09-07 Simplify streaming example.
145 get('/') { Stream.new }
aaeb564a »
2010-09-02 document route return values, fixes GH #23
146
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
147 == Static Files
047edc6a »
2008-03-26 update README with Static help
148
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
149 Static files are served from the <tt>./public</tt> directory. You can specify
150 a different location by setting the <tt>:public</tt> option:
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
151
152 set :public, File.dirname(__FILE__) + '/static'
df800b5c »
2008-03-24 Docs are started
153
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
154 Note that the public directory name is not included in the URL. A file
85b4462b »
2009-01-24 README: fix formatting on static file note
155 <tt>./public/css/style.css</tt> is made available as
156 <tt>http://example.com/css/style.css</tt>.
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
157
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
158 == Views / Templates
df800b5c »
2008-03-24 Docs are started
159
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
160 Templates are assumed to be located directly under the <tt>./views</tt>
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
161 directory. To use a different views directory:
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
162
163 set :views, File.dirname(__FILE__) + '/templates'
164
06161bf7 »
2009-03-25 Note on passing template symbols vs. strings in README
165 One important thing to remember is that you always have to reference
166 templates with symbols, even if they're in a subdirectory (in this
12557377 »
2010-09-23 Added a transition to better explain that templates must be defined w…
167 case use <tt>:'subdir/template'</tt>). You must use a symbol because
168 otherwise rendering methods will render any strings passed to them
169 directly.
06161bf7 »
2009-03-25 Note on passing template symbols vs. strings in README
170
f44fb6aa »
2008-08-31 grammar/formatting pass over README
171 === Haml Templates
df800b5c »
2008-03-24 Docs are started
172
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
173 The haml gem/library is required to render HAML templates:
174
801163e9 »
2009-04-24 closes #9779 Auto-require haml/erb/builder/sass
175 ## You'll need to require haml in your app
176 require 'haml'
177
df800b5c »
2008-03-24 Docs are started
178 get '/' do
179 haml :index
180 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
181
182 Renders <tt>./views/index.haml</tt>.
183
0321ada6 »
2010-05-26 In README docs, fix links to HAML and SASS Options pages.
184 {Haml's options}[http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#options]
d359dc9c »
2009-03-15 Merge app-level haml/sass options with call options [#184]
185 can be set globally through Sinatra's configurations,
186 see {Options and Configurations}[http://www.sinatrarb.com/configuration.html],
187 and overridden on an individual basis.
188
c37db5cd »
2010-09-07 minor adjustments and fixes for the readme examples
189 set :haml, :format => :html5 # default Haml format is :xhtml
d359dc9c »
2009-03-15 Merge app-level haml/sass options with call options [#184]
190
191 get '/' do
c37db5cd »
2010-09-07 minor adjustments and fixes for the readme examples
192 haml :index, :format => :html4 # overridden
d359dc9c »
2009-03-15 Merge app-level haml/sass options with call options [#184]
193 end
194
195
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
196 === Erb Templates
f44fb6aa »
2008-08-31 grammar/formatting pass over README
197
801163e9 »
2009-04-24 closes #9779 Auto-require haml/erb/builder/sass
198 ## You'll need to require erb in your app
199 require 'erb'
200
f44fb6aa »
2008-08-31 grammar/formatting pass over README
201 get '/' do
202 erb :index
203 end
204
205 Renders <tt>./views/index.erb</tt>
206
7c5d6937 »
2009-12-23 Doc for erubis
207 === Erubis
208
84f2e0c1 »
2010-06-27 Correction to erubis template rendering instructions
209 The erubis gem/library is required to render erubis templates:
7c5d6937 »
2009-12-23 Doc for erubis
210
211 ## You'll need to require erubis in your app
212 require 'erubis'
213
214 get '/' do
215 erubis :index
216 end
217
218 Renders <tt>./views/index.erubis</tt>
219
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
220 === Builder Templates
f44fb6aa »
2008-08-31 grammar/formatting pass over README
221
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
222 The builder gem/library is required to render builder templates:
df800b5c »
2008-03-24 Docs are started
223
801163e9 »
2009-04-24 closes #9779 Auto-require haml/erb/builder/sass
224 ## You'll need to require builder in your app
225 require 'builder'
226
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
227 get '/' do
228 content_type 'application/xml', :charset => 'utf-8'
229 builder :index
230 end
231
232 Renders <tt>./views/index.builder</tt>.
233
234 === Sass Templates
235
236 The sass gem/library is required to render Sass templates:
f44fb6aa »
2008-08-31 grammar/formatting pass over README
237
801163e9 »
2009-04-24 closes #9779 Auto-require haml/erb/builder/sass
238 ## You'll need to require haml or sass in your app
239 require 'sass'
240
4144ac1a »
2008-04-08 Added Sass information to documentation.
241 get '/stylesheet.css' do
ccc19b04 »
2008-04-13 content_type response helper with mime type lookup and parameter supp…
242 content_type 'text/css', :charset => 'utf-8'
4144ac1a »
2008-04-08 Added Sass information to documentation.
243 sass :stylesheet
244 end
245
f44fb6aa »
2008-08-31 grammar/formatting pass over README
246 Renders <tt>./views/stylesheet.sass</tt>.
247
0321ada6 »
2010-05-26 In README docs, fix links to HAML and SASS Options pages.
248 {Sass' options}[http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options]
d359dc9c »
2009-03-15 Merge app-level haml/sass options with call options [#184]
249 can be set globally through Sinatra's configurations,
250 see {Options and Configurations}[http://www.sinatrarb.com/configuration.html],
251 and overridden on an individual basis.
252
c37db5cd »
2010-09-07 minor adjustments and fixes for the readme examples
253 set :sass, :style => :compact # default Sass style is :nested
d359dc9c »
2009-03-15 Merge app-level haml/sass options with call options [#184]
254
255 get '/stylesheet.css' do
256 content_type 'text/css', :charset => 'utf-8'
b90d00c8 »
2009-12-19 Update sass example re. options
257 sass :stylesheet, :style => :expanded # overridden
d359dc9c »
2009-03-15 Merge app-level haml/sass options with call options [#184]
258 end
259
cf3c218a »
2010-08-29 Adding scss support through specific command
260 === Scss Templates
261
262 The sass gem/library is required to render Scss templates:
263
264 ## You'll need to require haml or sass in your app
265 require 'sass'
266
267 get '/stylesheet.css' do
268 content_type 'text/css', :charset => 'utf-8'
269 scss :stylesheet
270 end
271
272 Renders <tt>./views/stylesheet.scss</tt>.
273
274 {Scss' options}[http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options]
275 can be set globally through Sinatra's configurations,
276 see {Options and Configurations}[http://www.sinatrarb.com/configuration.html],
277 and overridden on an individual basis.
278
c37db5cd »
2010-09-07 minor adjustments and fixes for the readme examples
279 set :scss, :style => :compact # default Scss style is :nested
cf3c218a »
2010-08-29 Adding scss support through specific command
280
281 get '/stylesheet.css' do
282 content_type 'text/css', :charset => 'utf-8'
283 scss :stylesheet, :style => :expanded # overridden
284 end
285
621bfcbd »
2010-03-01 Added Less support
286 === Less Templates
287
288 The less gem/library is required to render Less templates:
289
290 ## You'll need to require less in your app
291 require 'less'
292
293 get '/stylesheet.css' do
294 content_type 'text/css', :charset => 'utf-8'
295 less :stylesheet
296 end
297
298 Renders <tt>./views/stylesheet.less</tt>.
299
28a3a350 »
2010-09-11 Add liquid helper method. Tilt supports liquid for quite some time no…
300 === Liquid Templates
301
302 The liquid gem/library is required to render Liquid templates:
303
304 ## You'll need to require liquid in your app
305 require 'liquid'
306
307 get '/' do
308 liquid :index
309 end
310
311 Renders <tt>./views/index.liquid</tt>.
312
313 Since you cannot call Ruby methods (except for +yield+) from a Liquid
314 template, you almost always want to pass locals to it:
315
316 liquid :index, :locals => { :key => 'value' }
317
970169b1 »
2010-09-11 Add markdown helper method. Tilt supports markdown for quite some tim…
318 === Markdown Templates
319
320 The rdiscount gem/library is required to render Markdown templates:
321
322 ## You'll need to require rdiscount in your app
323 require "rdiscount"
324
325 get '/' do
326 markdown :index
327 end
328
329 Renders <tt>./views/index.markdown</tt> (+md+ and +mkd+ are also valid file
330 extensions).
331
332 It is not possible to call methods from markdown, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
333
334 erb :overview, :locals => { :text => markdown(:introduction) }
335
336 Note that you may also call the markdown method from within other templates:
337
338 %h1 Hello From Haml!
339 %p= markdown(:greetings)
340
b464e024 »
2010-09-11 Add textile helper method. Tilt supports textile for quite some time …
341 === Textile Templates
342
343 The RedCloth gem/library is required to render Textile templates:
344
345 ## You'll need to require rdiscount in your app
346 require "redcloth"
347
348 get '/' do
349 textile :index
350 end
351
352 Renders <tt>./views/index.textile</tt>.
353
354 It is not possible to call methods from textile, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
355
356 erb :overview, :locals => { :text => textile(:introduction) }
357
358 Note that you may also call the textile method from within other templates:
359
360 %h1 Hello From Haml!
361 %p= textile(:greetings)
362
c248dbac »
2010-09-12 Add rdoc helper method. Tilt supports RDoc for quite some time now, b…
363 === RDoc Templates
364
365 The RDoc gem/library is required to render RDoc templates:
366
367 ## You'll need to require rdiscount in your app
368 require "rdoc"
369
370 get '/' do
371 rdoc :index
372 end
373
374 Renders <tt>./views/index.rdoc</tt>.
375
376 It is not possible to call methods from rdoc, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
377
378 erb :overview, :locals => { :text => rdoc(:introduction) }
379
380 Note that you may also call the rdoc method from within other templates:
381
382 %h1 Hello From Haml!
383 %p= rdoc(:greetings)
384
7cb94f2d »
2010-09-12 Add radius helper method. Tilt supports radius for quite some time no…
385 === Radius Templates
386
387 The radius gem/library is required to render Radius templates:
388
389 ## You'll need to require radius in your app
390 require 'radius'
391
392 get '/' do
393 radius :index
394 end
395
396 Renders <tt>./views/index.radius</tt>.
397
398 Since you cannot call Ruby methods (except for +yield+) from a Radius
399 template, you almost always want to pass locals to it:
400
401 radius :index, :locals => { :key => 'value' }
402
8ce74b3a »
2010-09-12 Add markaby helper method. Tilt supports Markaby for quite some time …
403 === Markaby Templates
404
405 The markaby gem/library is required to render Markaby templates:
406
407 ## You'll need to require markaby in your app
408 require 'markaby'
409
410 get '/' do
411 markaby :index
412 end
413
414 Renders <tt>./views/index.mab</tt>.
415
f58d015b »
2010-09-12 Add coffee helper method. Tilt supports CoffeeScript again, but it wa…
416 === CoffeeScript Templates
417
418 The coffee-script gem/library and the `coffee` binary are required to render
419 CoffeeScript templates:
420
421 ## You'll need to require coffee-script in your app
422 require 'coffee-script'
423
424 get '/application.js' do
425 content_type 'text/javascript', :charset => 'utf-8'
426 coffee :application
427 end
428
429 Renders <tt>./views/application.coffee</tt>.
430
f44fb6aa »
2008-08-31 grammar/formatting pass over README
431 === Inline Templates
df800b5c »
2008-03-24 Docs are started
432
433 get '/' do
434 haml '%div.title Hello World'
435 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
436
437 Renders the inlined template string.
df800b5c »
2008-03-24 Docs are started
438
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
439 === Accessing Variables in Templates
df800b5c »
2008-03-24 Docs are started
440
5018264d »
2009-03-01 Tidy up README a bit; link to @sinatra on Twitter
441 Templates are evaluated within the same context as route handlers. Instance
442 variables set in route handlers are direcly accessible by templates:
df800b5c »
2008-03-24 Docs are started
443
444 get '/:id' do
445 @foo = Foo.find(params[:id])
95aca761 »
2008-11-30 fix documentation of variable interpolation into templates
446 haml '%h1= @foo.name'
df800b5c »
2008-03-24 Docs are started
447 end
448
f44fb6aa »
2008-08-31 grammar/formatting pass over README
449 Or, specify an explicit Hash of local variables:
df800b5c »
2008-03-24 Docs are started
450
451 get '/:id' do
f44fb6aa »
2008-08-31 grammar/formatting pass over README
452 foo = Foo.find(params[:id])
95aca761 »
2008-11-30 fix documentation of variable interpolation into templates
453 haml '%h1= foo.name', :locals => { :foo => foo }
df800b5c »
2008-03-24 Docs are started
454 end
455
f44fb6aa »
2008-08-31 grammar/formatting pass over README
456 This is typically used when rendering templates as partials from within
457 other templates.
458
3ef8eede »
2009-12-19 Deprecate use_in_file_templates!
459 === Inline Templates
83cba9cf »
2008-03-29 updated README with helpful tidbits
460
f44fb6aa »
2008-08-31 grammar/formatting pass over README
461 Templates may be defined at the end of the source file:
83cba9cf »
2008-03-29 updated README with helpful tidbits
462
eec7d214 »
2009-01-16 In-file-templates are automaticly loaded for you.
463 require 'sinatra'
464
83cba9cf »
2008-03-29 updated README with helpful tidbits
465 get '/' do
466 haml :index
467 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
468
83cba9cf »
2008-03-29 updated README with helpful tidbits
469 __END__
f44fb6aa »
2008-08-31 grammar/formatting pass over README
470
f71330e6 »
2008-05-07 quick doc fix
471 @@ layout
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
472 %html
473 = yield
f44fb6aa »
2008-08-31 grammar/formatting pass over README
474
f71330e6 »
2008-05-07 quick doc fix
475 @@ index
83cba9cf »
2008-03-29 updated README with helpful tidbits
476 %div.title Hello world!!!!!
477
3ef8eede »
2009-12-19 Deprecate use_in_file_templates!
478 NOTE: Inline templates defined in the source file that requires sinatra
fa527095 »
2010-09-03 fix markup for inline code in README
479 are automatically loaded. Call +enable :inline_templates+ explicitly if you
3ef8eede »
2009-12-19 Deprecate use_in_file_templates!
480 have inline templates in other source files.
eec7d214 »
2009-01-16 In-file-templates are automaticly loaded for you.
481
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
482 === Named Templates
483
5018264d »
2009-03-01 Tidy up README a bit; link to @sinatra on Twitter
484 Templates may also be defined using the top-level <tt>template</tt> method:
83cba9cf »
2008-03-29 updated README with helpful tidbits
485
486 template :layout do
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
487 "%html\n =yield\n"
83cba9cf »
2008-03-29 updated README with helpful tidbits
488 end
489
490 template :index do
491 '%div.title Hello World!'
492 end
493
494 get '/' do
495 haml :index
496 end
497
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
498 If a template named "layout" exists, it will be used each time a template
499 is rendered. You can disable layouts by passing <tt>:layout => false</tt>.
578bbabd »
2009-01-09 Updating README for :layout => true.
500
501 get '/' do
502 haml :index, :layout => !request.xhr?
503 end
504
f44fb6aa »
2008-08-31 grammar/formatting pass over README
505 == Helpers
df800b5c »
2008-03-24 Docs are started
506
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
507 Use the top-level <tt>helpers</tt> method to define helper methods for use in
5018264d »
2009-03-01 Tidy up README a bit; link to @sinatra on Twitter
508 route handlers and templates:
df800b5c »
2008-03-24 Docs are started
509
510 helpers do
511 def bar(name)
512 "#{name}bar"
513 end
514 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
515
1776a80d »
2008-03-24 Added Version and Docs
516 get '/:name' do
517 bar(params[:name])
518 end
df800b5c »
2008-03-24 Docs are started
519
f44fb6aa »
2008-08-31 grammar/formatting pass over README
520 == Filters
df800b5c »
2008-03-24 Docs are started
521
c6d06148 »
2010-09-10 Minor README improvements.
522 Before filters are evaluated before each request within the same context as
523 the routes will be and can modify the request and response. Instance variables
524 set in filters are accessible by routes and templates:
1776a80d »
2008-03-24 Added Version and Docs
525
df800b5c »
2008-03-24 Docs are started
526 before do
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
527 @note = 'Hi!'
528 request.path_info = '/foo/bar/baz'
529 end
530
531 get '/foo/*' do
532 @note #=> 'Hi!'
533 params[:splat] #=> 'bar/baz'
df800b5c »
2008-03-24 Docs are started
534 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
535
c6d06148 »
2010-09-10 Minor README improvements.
536 After filter are evaluated after each request within the same context and can
537 also modify the request and response. Instance variables set in before filters
538 and routes are accessible by after filters:
4e50ddbc »
2008-12-21 Adds after filters
539
540 after do
541 puts response.status
542 end
543
c6d06148 »
2010-09-10 Minor README improvements.
544 Filters optionally taking a pattern, causing them to be evaluated only if the
545 request path matches that pattern:
da047d3d »
2010-04-27 add pattern matching to before/after filters.
546
547 before '/protected/*' do
548 authenticate!
549 end
550
551 after '/create/:slug' do |slug|
552 session[:last_slug] = slug
553 end
554
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
555 == Halting
a734cf38 »
2008-12-13 I knew I shoulda taken that left turn at Hoboken
556
4e50ddbc »
2008-12-21 Adds after filters
557 To immediately stop a request within a filter or route use:
df800b5c »
2008-03-24 Docs are started
558
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
559 halt
f44fb6aa »
2008-08-31 grammar/formatting pass over README
560
c6d06148 »
2010-09-10 Minor README improvements.
561 You can also specify the status when halting:
fbbd8227 »
2009-12-19 More 'halt' doc
562
563 halt 410
564
c6d06148 »
2010-09-10 Minor README improvements.
565 Or the body:
df800b5c »
2008-03-24 Docs are started
566
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
567 halt 'this will be the body'
df800b5c »
2008-03-24 Docs are started
568
c6d06148 »
2010-09-10 Minor README improvements.
569 Or both:
f44fb6aa »
2008-08-31 grammar/formatting pass over README
570
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
571 halt 401, 'go away!'
df800b5c »
2008-03-24 Docs are started
572
c6d06148 »
2010-09-10 Minor README improvements.
573 With headers:
fbbd8227 »
2009-12-19 More 'halt' doc
574
575 halt 402, {'Content-Type' => 'text/plain'}, 'revenge'
576
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
577 == Passing
f44fb6aa »
2008-08-31 grammar/formatting pass over README
578
5018264d »
2009-03-01 Tidy up README a bit; link to @sinatra on Twitter
579 A route can punt processing to the next matching route using <tt>pass</tt>:
df800b5c »
2008-03-24 Docs are started
580
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
581 get '/guess/:who' do
582 pass unless params[:who] == 'Frank'
6c9488e2 »
2009-12-23 Stick to single quote; kill a blank line
583 'You got me!'
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
584 end
585
586 get '/guess/*' do
6c9488e2 »
2009-12-23 Stick to single quote; kill a blank line
587 'You missed!'
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
588 end
589
590 The route block is immediately exited and control continues with the next
591 matching route. If no matching route is found, a 404 is returned.
df800b5c »
2008-03-24 Docs are started
592
13fc79d3 »
2009-03-24 Remove support for source file reloading [#166]
593 == Configuration
1776a80d »
2008-03-24 Added Version and Docs
594
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
595 Run once, at startup, in any environment:
1776a80d »
2008-03-24 Added Version and Docs
596
597 configure do
e75f4b3f »
2008-09-09 misc README formatting tweaks
598 ...
1776a80d »
2008-03-24 Added Version and Docs
599 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
600
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
601 Run only when the environment (RACK_ENV environment variable) is set to
13fc79d3 »
2009-03-24 Remove support for source file reloading [#166]
602 <tt>:production</tt>:
1776a80d »
2008-03-24 Added Version and Docs
603
604 configure :production do
e75f4b3f »
2008-09-09 misc README formatting tweaks
605 ...
1776a80d »
2008-03-24 Added Version and Docs
606 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
607
13fc79d3 »
2009-03-24 Remove support for source file reloading [#166]
608 Run when the environment is set to either <tt>:production</tt> or
609 <tt>:test</tt>:
1776a80d »
2008-03-24 Added Version and Docs
610
611 configure :production, :test do
e75f4b3f »
2008-09-09 misc README formatting tweaks
612 ...
1776a80d »
2008-03-24 Added Version and Docs
613 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
614
e75f4b3f »
2008-09-09 misc README formatting tweaks
615 == Error handling
1776a80d »
2008-03-24 Added Version and Docs
616
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
617 Error handlers run within the same context as routes and before filters, which
c6d06148 »
2010-09-10 Minor README improvements.
618 means you get all the goodies it has to offer, like <tt>haml</tt>,
619 <tt>erb</tt>, <tt>halt</tt>, etc.
1776a80d »
2008-03-24 Added Version and Docs
620
e75f4b3f »
2008-09-09 misc README formatting tweaks
621 === Not Found
1776a80d »
2008-03-24 Added Version and Docs
622
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
623 When a <tt>Sinatra::NotFound</tt> exception is raised, or the response's status
624 code is 404, the <tt>not_found</tt> handler is invoked:
1776a80d »
2008-03-24 Added Version and Docs
625
626 not_found do
c6d06148 »
2010-09-10 Minor README improvements.
627 'This is nowhere to be found.'
1776a80d »
2008-03-24 Added Version and Docs
628 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
629
e75f4b3f »
2008-09-09 misc README formatting tweaks
630 === Error
83cba9cf »
2008-03-29 updated README with helpful tidbits
631
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
632 The +error+ handler is invoked any time an exception is raised from a route
63fd7734 »
2009-12-19 Small doc fix re. after filter
633 block or a filter. The exception object can be obtained from the
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
634 <tt>sinatra.error</tt> Rack variable:
83cba9cf »
2008-03-29 updated README with helpful tidbits
635
1776a80d »
2008-03-24 Added Version and Docs
636 error do
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
637 'Sorry there was a nasty error - ' + env['sinatra.error'].name
83cba9cf »
2008-03-29 updated README with helpful tidbits
638 end
639
e75f4b3f »
2008-09-09 misc README formatting tweaks
640 Custom errors:
83cba9cf »
2008-03-29 updated README with helpful tidbits
641
642 error MyCustomError do
e7e0e558 »
2008-04-14 Minor docfixes in README.rdoc
643 'So what happened was...' + request.env['sinatra.error'].message
1776a80d »
2008-03-24 Added Version and Docs
644 end
83cba9cf »
2008-03-29 updated README with helpful tidbits
645
e75f4b3f »
2008-09-09 misc README formatting tweaks
646 Then, if this happens:
83cba9cf »
2008-03-29 updated README with helpful tidbits
647
648 get '/' do
649 raise MyCustomError, 'something bad'
650 end
651
e75f4b3f »
2008-09-09 misc README formatting tweaks
652 You get this:
83cba9cf »
2008-03-29 updated README with helpful tidbits
653
654 So what happened was... something bad
f44fb6aa »
2008-08-31 grammar/formatting pass over README
655
59e797e9 »
2009-12-23 Doc for error(500) { }
656 Alternatively, you can install error handler for a status code:
657
658 error 403 do
659 'Access forbidden'
660 end
661
662 get '/secret' do
663 403
664 end
665
666 Or a range:
667
668 error 400..510 do
669 'Boom'
670 end
671
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
672 Sinatra installs special <tt>not_found</tt> and <tt>error</tt> handlers when
673 running under the development environment.
83cba9cf »
2008-03-29 updated README with helpful tidbits
674
f44fb6aa »
2008-08-31 grammar/formatting pass over README
675 == Mime types
676
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
677 When using <tt>send_file</tt> or static files you may have mime types Sinatra
6d8b333a »
2009-10-18 Update README re. mime_type
678 doesn't understand. Use +mime_type+ to register them by file extension:
83cba9cf »
2008-03-29 updated README with helpful tidbits
679
6d8b333a »
2009-10-18 Update README re. mime_type
680 mime_type :foo, 'text/foo'
1776a80d »
2008-03-24 Added Version and Docs
681
cb8fcb63 »
2009-12-23 Doc for content_type :foo
682 You can also use it with the +content_type+ helper:
683
684 content_type :foo
685
f44fb6aa »
2008-08-31 grammar/formatting pass over README
686 == Rack Middleware
bda21f1f »
2008-05-19 add doc on using Rack middleware to README
687
f44fb6aa »
2008-08-31 grammar/formatting pass over README
688 Sinatra rides on Rack[http://rack.rubyforge.org/], a minimal standard
689 interface for Ruby web frameworks. One of Rack's most interesting capabilities
690 for application developers is support for "middleware" -- components that sit
691 between the server and your application monitoring and/or manipulating the
692 HTTP request/response to provide various types of common functionality.
bda21f1f »
2008-05-19 add doc on using Rack middleware to README
693
e75f4b3f »
2008-09-09 misc README formatting tweaks
694 Sinatra makes building Rack middleware pipelines a cinch via a top-level
695 +use+ method:
bda21f1f »
2008-05-19 add doc on using Rack middleware to README
696
697 require 'sinatra'
698 require 'my_custom_middleware'
699
700 use Rack::Lint
701 use MyCustomMiddleware
702
703 get '/hello' do
704 'Hello World'
705 end
706
f44fb6aa »
2008-08-31 grammar/formatting pass over README
707 The semantics of +use+ are identical to those defined for the
708 Rack::Builder[http://rack.rubyforge.org/doc/classes/Rack/Builder.html] DSL
709 (most frequently used from rackup files). For example, the +use+ method
710 accepts multiple/variable args as well as blocks:
bda21f1f »
2008-05-19 add doc on using Rack middleware to README
711
712 use Rack::Auth::Basic do |username, password|
713 username == 'admin' && password == 'secret'
714 end
715
f44fb6aa »
2008-08-31 grammar/formatting pass over README
716 Rack is distributed with a variety of standard middleware for logging,
717 debugging, URL routing, authentication, and session handling. Sinatra uses
718 many of of these components automatically based on configuration so you
719 typically don't have to +use+ them explicitly.
bda21f1f »
2008-05-19 add doc on using Rack middleware to README
720
f44fb6aa »
2008-08-31 grammar/formatting pass over README
721 == Testing
1776a80d »
2008-03-24 Added Version and Docs
722
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
723 Sinatra tests can be written using any Rack-based testing library
724 or framework. {Rack::Test}[http://gitrdoc.com/brynary/rack-test] is
725 recommended:
c00a25ee »
2009-01-13 Test framework refactoring
726
7cfe04a9 »
2008-09-24 Fix for test/unit and test/spec docs
727 require 'my_sinatra_app'
c3f167f7 »
2010-07-26 MOD: docs for testing forgot to require test/unit
728 require 'test/unit'
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
729 require 'rack/test'
f44fb6aa »
2008-08-31 grammar/formatting pass over README
730
1776a80d »
2008-03-24 Added Version and Docs
731 class MyAppTest < Test::Unit::TestCase
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
732 include Rack::Test::Methods
733
734 def app
735 Sinatra::Application
736 end
f44fb6aa »
2008-08-31 grammar/formatting pass over README
737
2f377e26 »
2009-03-01 Trim down Testing section in the README; link to doc site instead
738 def test_my_default
c00a25ee »
2009-01-13 Test framework refactoring
739 get '/'
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
740 assert_equal 'Hello World!', last_response.body
1776a80d »
2008-03-24 Added Version and Docs
741 end
10c90d5f »
2008-09-27 document testing with rspec
742
2f377e26 »
2009-03-01 Trim down Testing section in the README; link to doc site instead
743 def test_with_params
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
744 get '/meet', :name => 'Frank'
745 assert_equal 'Hello Frank!', last_response.body
10c90d5f »
2008-09-27 document testing with rspec
746 end
747
2f377e26 »
2009-03-01 Trim down Testing section in the README; link to doc site instead
748 def test_with_rack_env
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
749 get '/', {}, 'HTTP_USER_AGENT' => 'Songbird'
750 assert_equal "You're using Songbird!", last_response.body
1fb5b99d »
2009-01-09 Bacon support
751 end
752 end
753
c831278a »
2009-05-18 Recommend Rack::Test in README / note Sinatra::Test deprecation
754 NOTE: The built-in Sinatra::Test module and Sinatra::TestHarness class
755 are deprecated as of the 0.9.2 release.
1776a80d »
2008-03-24 Added Version and Docs
756
53603333 »
2009-06-06 Add a note about Sinatra::Base to the README
757 == Sinatra::Base - Middleware, Libraries, and Modular Apps
758
759 Defining your app at the top-level works well for micro-apps but has
760 considerable drawbacks when building reuseable components such as Rack
761 middleware, Rails metal, simple libraries with a server component, or
762 even Sinatra extensions. The top-level DSL pollutes the Object namespace
763 and assumes a micro-app style configuration (e.g., a single application
764 file, ./public and ./views directories, logging, exception detail page,
765 etc.). That's where Sinatra::Base comes into play:
766
767 require 'sinatra/base'
768
769 class MyApp < Sinatra::Base
770 set :sessions, true
771 set :foo, 'bar'
772
773 get '/' do
774 'Hello world!'
775 end
776 end
777
778 The MyApp class is an independent Rack component that can act as
779 Rack middleware, a Rack application, or Rails metal. You can +use+ or
780 +run+ this class from a rackup +config.ru+ file; or, control a server
781 component shipped as a library:
782
783 MyApp.run! :host => 'localhost', :port => 9090
784
785 The methods available to Sinatra::Base subclasses are exactly as those
786 available via the top-level DSL. Most top-level apps can be converted to
787 Sinatra::Base components with two modifications:
788
789 * Your file should require +sinatra/base+ instead of +sinatra+;
790 otherwise, all of Sinatra's DSL methods are imported into the main
791 namespace.
792 * Put your app's routes, error handlers, filters, and options in a subclass
793 of Sinatra::Base.
794
795 +Sinatra::Base+ is a blank slate. Most options are disabled by default,
796 including the built-in server. See {Options and Configuration}[http://sinatra.github.com/configuration.html]
797 for details on available options and their behavior.
798
799 SIDEBAR: Sinatra's top-level DSL is implemented using a simple delegation
800 system. The +Sinatra::Application+ class -- a special subclass of
801 Sinatra::Base -- receives all :get, :put, :post, :delete, :before,
802 :error, :not_found, :configure, and :set messages sent to the
803 top-level. Have a look at the code for yourself: here's the
035fe470 »
2010-03-01 fix Delegator links in README
804 {Sinatra::Delegator mixin}[http://github.com/sinatra/sinatra/blob/ceac46f0bc129a6e994a06100aa854f606fe5992/lib/sinatra/base.rb#L1128]
805 being {included into the main namespace}[http://github.com/sinatra/sinatra/blob/ceac46f0bc129a6e994a06100aa854f606fe5992/lib/sinatra/main.rb#L28]
53603333 »
2009-06-06 Add a note about Sinatra::Base to the README
806
3f21c3f4 »
2010-09-24 Document different scopes/bindings.
807 == Scopes and Binding
808
809 The scope you are currently in determines what methods and variables are available.
810
811 === Application/Class Scope
812
813 Every Sinatra application corresponds to a subclass of Sinatra::Base. If you
814 are using the top level DSL (<tt>require 'sinatra'</tt>), then this class is
815 Sinatra::Application, otherwise it is the subclass you created explicitly. At
816 class level you have methods like `get` or `before`, but you cannot access the
817 `request` object or the `session`, as there only is a single application class
818 for all requests.
819
820 Options created via `set` are methods at class level:
821
822 class MyApp << Sinatra::Base
823 # Hey, I'm in the application scope!
824 set :foo, 42
825 foo # => 42
826
827 get '/foo' do
828 # Hey, I'm no longer in the application scope!
829 end
830 end
831
832 You have the application scope binding inside
833
834 * Your application class body
835 * Methods defined by extensions
836 * The block passed to `helpers`
837 * Procs/blocks used as value for `set`
838
839 You can reach the scope object (the class) like this:
840
841 * The object passed to configure blocks (<tt>configure { |c| ... }</tt>)
842 * `settings` from within request scope
843
844 === Request/Instance Scope
845
846 For every incoming request a new instance of your application class is created
847 and all handler blocks run in that scope. From within this scope you can
848 access the `request` or `session` object and call methods like `erb` or
849 `haml`. You can access the application scope from within the request scope via
850 the `settings` helper.
851
852 class MyApp << Sinatra::Base
853 # Hey, I'm in the application scope!
854 get '/define_route/:name' do
855 # Request scope for '/define_route/:name'
856 @value = 42
857
858 settings.get("/#{params[:name]}") do
859 # Request scope for "/#{params[:name]}"
860 @value # => nil (not the same request)
861 end
862
863 "Route defined!"
864 end
865 end
866
867 You have the request scope binding inside
868
869 * get/head/post/put/delete blocks
870 * before/after filters
871 * helper methods
872 * templates/views
873
874 === Delegation Scope
875
876 The delegation scope just forwards methods to the class scope. However, it
877 does not behave 100% like the class scope, as you do not have the classes
878 bindings: Only methods explicitly marked for delegation are available and you
879 do not share variables with the class scope (read: you have a different
880 `self`).
881
882 You have the delegate scope binding inside
883
884 * The top level binding, if you did <tt>require "sinatra"</tt>
885 * A object extended with the `Sinatra::Delegator` mixin
886
f44fb6aa »
2008-08-31 grammar/formatting pass over README
887 == Command line
1776a80d »
2008-03-24 Added Version and Docs
888
e75f4b3f »
2008-09-09 misc README formatting tweaks
889 Sinatra applications can be run directly:
f44fb6aa »
2008-08-31 grammar/formatting pass over README
890
4d616071 »
2010-03-01 update README/CHANGES re. -o
891 ruby myapp.rb [-h] [-x] [-e ENVIRONMENT] [-p PORT] [-o HOST] [-s HANDLER]
1776a80d »
2008-03-24 Added Version and Docs
892
893 Options are:
894
895 -h # help
896 -p # set the port (default is 4567)
4d616071 »
2010-03-01 update README/CHANGES re. -o
897 -o # set the host (default is 0.0.0.0)
1776a80d »
2008-03-24 Added Version and Docs
898 -e # set the environment (default is development)
f29486ba »
2009-01-15 Note "-s" (server) command line option in README
899 -s # specify rack server/handler (default is thin)
e7e0e558 »
2008-04-14 Minor docfixes in README.rdoc
900 -x # turn on the mutex lock (default is off)
1776a80d »
2008-03-24 Added Version and Docs
901
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
902 == The Bleeding Edge
6326809e »
2008-08-31 Add a subsection about tools needed for Sinatra to the Contributing s…
903
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
904 If you would like to use Sinatra's latest bleeding code, create a local
905 clone and run your app with the <tt>sinatra/lib</tt> directory on the
906 <tt>LOAD_PATH</tt>:
6326809e »
2008-08-31 Add a subsection about tools needed for Sinatra to the Contributing s…
907
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
908 cd myapp
ba92616e »
2009-01-18 Updated README to point to github.com/sinatra/sinatra.git
909 git clone git://github.com/sinatra/sinatra.git
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
910 ruby -Isinatra/lib myapp.rb
480fbfa7 »
2008-08-31 minor formatting tweaks to cypher's README updates
911
4f30c1ce »
2009-05-12 fix unclosed <tt> in README
912 Alternatively, you can add the <tt>sinatra/lib</tt> directory to the
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
913 <tt>LOAD_PATH</tt> in your application:
1776a80d »
2008-03-24 Added Version and Docs
914
17cb177e »
2009-01-11 README and CHANGES tweaks for 0.9.0 release (#63)
915 $LOAD_PATH.unshift File.dirname(__FILE__) + '/sinatra/lib'
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
916 require 'rubygems'
1776a80d »
2008-03-24 Added Version and Docs
917 require 'sinatra'
918
919 get '/about' do
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
920 "I'm running version " + Sinatra::VERSION
1776a80d »
2008-03-24 Added Version and Docs
921 end
e6c5471a »
2008-08-31 Add a community section with info about the mailing list and irc channel
922
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
923 To update the Sinatra sources in the future:
d8fec168 »
2008-08-31 Add subsection about contributing a patch as well as a link to the is…
924
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
925 cd myproject/sinatra
926 git pull
e6c5471a »
2008-08-31 Add a community section with info about the mailing list and irc channel
927
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
928 == More
e6c5471a »
2008-08-31 Add a community section with info about the mailing list and irc channel
929
754f116a »
2010-03-07 README: better links to project website and mailing list
930 * {Project Website}[http://www.sinatrarb.com/] - Additional documentation,
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
931 news, and links to other resources.
754f116a »
2010-03-07 README: better links to project website and mailing list
932 * {Contributing}[http://www.sinatrarb.com/contributing] - Find a bug? Need
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
933 help? Have a patch?
60ac4490 »
2010-07-01 lighthouse => github issue
934 * {Issue tracker}[http://github.com/sinatra/sinatra/issues]
5018264d »
2009-03-01 Tidy up README a bit; link to @sinatra on Twitter
935 * {Twitter}[http://twitter.com/sinatra]
754f116a »
2010-03-07 README: better links to project website and mailing list
936 * {Mailing List}[http://groups.google.com/group/sinatrarb/topics]
4298a777 »
2009-01-23 Tweak README formatting; move community/contributing to website
937 * {IRC: #sinatra}[irc://chat.freenode.net/#sinatra] on http://freenode.net
Something went wrong with that request. Please try again.