Open adamakhtar opened 12 years ago
oh and ill go ahead and open an issue for the walkthrough
How would you recommend me to start with Sinatra? I've never used it before.
Ive only tinkered with sinatra a bit and that was a year ago, but compared to rails it was so easy to get something up on the screen. Try the hello world example in the [readme] https://github.com/codereading/sinatra (about 6 lines of code) and try a few of the other features listed. Probably enough for codereading purposes.
there is a really good book about sinatra - http://shop.oreilly.com/product/0636920019664.do
erich the whole point of this walkthrough is walking through Sinatra's code not how to use Sinatra which is what the Sinatra book is for. thecode internal to sinatra itself. its own source code for how it does things.
Some ideas for questions to motivate our reading -
halt
? pass
?Sinatra::Base
), get executed in the context of a request?rackup
, or via the web server?+1 for ericgj's point number 7. That particular bit of Sinatra amazes me.
@ptn I agree. Point 7 and 5 is quite interesting.
Nice ideas @ericgj
How about we start with number 7 everyone?
+1
Just opened a new issue for discussing this see #4
Pretty nice list of ideas @ericgj . I think it would be good to move this individual number into its own issue, so everyone could discuss whatever they are interested. What do you think? @codereading/readers
I would like to find out on 7 and 9. For number 9, I would like to see why Sinatra decides to choose class variable as a separator for inline template.
For number 7, can you give me an example of a classic Sinatra app? I mean, a small code sample.
@jamandbees, the one in the Walkthrough thread. You require 'sinatra'
instead of require 'sinatra/base'
, and just put your routes down on the top-level object. As opposed to the 'modular' style. There's detailed explanation of the differences in the Intro documentation.
I thought so.
If you require "sinatra", it loads "sinatra.rb" which in turn loads "sinatra/base" and "sinatra/main".
main looks like it processes any arguments first. I'm honestly not quite following where main then uses base to do anything; I feel like I'm missing something simple there.
@jamandbees: see discussion in issue #4. Note class Application < Base
in main.
@codereading/readers After rack it seemed that various people wanted to achieve different things from the code reading sessions - which is great! As the group was fairly new it was a bit difficult to figure out exactly how to achieve the various goals or even how to conduct a code reading session.
One thing that seemed to take off at the end was the walk through that I and several others participated in. It didn't go way deep into the code but it did have a nice feel to it and also leaves a documented explanation, albeit small one, for anyone who ventures over here in the future. For me that's enough. But how about you? Perhaps you want to really dig into the details or take a different approach.
If that is the case then please feel free to state what your interested in here or by opening up an issue and try and find other interested members in the group. I think it would be great having multiple mini groups scouring over the same codebase.