1 Sinatra (C) 2007 By Blake Mizerany
3 = Classy web-development dressed in a DSL
7 sudo gem install sinatra -y
11 I'm going to move quick. I'll let you drool at your own pace.
13 * Create a file called lyrics.rb (or any name you like)
19 * Run (yes, with just ruby)
21 == Sinata has taken the stage on port 4567!
23 * Take a moment and view the default page http://localhost:4567. Go ahead and bask in it's glory.
26 * It didn't create any page to show you that default page (just a cool thing to see, that's all)
27 * There was nothing generated other than a log file
28 * Sinatra is a really cool name for a web-framework that's a DSL
30 * Modify lyrics.rb by adding:
35 * Refresh (no need to restart Sinatra):
38 * Modify again (then refresh):
41 <form action='/' method="POST">
42 <input type="text" name="name" />
43 <input type="submit" value="Say my name!" />
49 "Hello #{params[:name] || 'World'}!"
53 Use the Sinatra::Erb::EventContext or Sinatra::Haml::EventContext to do the same. Do them inline and as template files.
55 * Learn more cool stuff:
58 * Create your own plugins!
59 1. Create a 'vendor' directory in your app directory
65 | - init.rb # load and hook here
67 |- modules/classes here
69 3. Use it in your app!
71 see $SINATRA_GEM_ROOT/vendor/erb or $SINATRA_GEM_ROOT/vendor/erb for examples.
74 We would love to here what you're doing with Sinatra and any cool patches/features you would like. (blake { dot } mizerany [ at ] gmail)
77 IRC (irc.freenode.com #sinatra)
78 Mailing List (sinatrarb@googlegroups.com)
82 We're using git as our scm.. cuz.. it rocks. You can get the latest source from http://repo.or.cz/w/sinatra.git
84 NOTE: You can also get tar'd snapshots of each commit there too. So technically you don't need git to get the latest code.
86 It's probably going to happen.. you'll find a bug. Please help by:
88 * Sending a message to sintrarb@googlegroups.com with BUG: at the start of the subject (I'm working on a better tracking system)
89 * Please send patches or pull requests to (blake { dot } mizerany [ at ] gmail) don't forget the dot com. ;)
93 - Ezra Zygmuntowicz (http://brainspl.at) for answering all those random questions over IM and all the poached code
94 - Ditto to Chris Wanstrath (errtheblog.com) and helping me keep things simple, and some cool tricks
95 - Ari Lerner over at CitrusByte for ideas, code, and enthusiasm
96 - Koshi (http://www.songbirdnest.com/jkoshi/blog) here at POTI, Inc. for the Sinatra mark
97 - Pete Golibersuch for the hat logo
98 - John Philip Green (http://www.linkedin.com/in/johngreen) for motivation and evangelism
99 - The team here at songbirdnest.com for cool ideas