Have you ever wanted to build your own web framework? Do you want to learn howto create Rack applications?
The first time I found out about Sinatra, I had already created my own Rack-based web framework and I wasn’t particularly interested in Sinatra. It’s really just a pretty DSL for Rack. Those days, I used Camping for micro web applications. Nowadays, I use Sinatra all the time … it rocks! And, as Yehuda recently pointed out, Sinatra is getting lots of hype lately. And so is Rack!
So, what better time to learn how to use Rack to implement the Sinatra DSL, yourself!
Episode Guide
- Part I: Simple proof of concept script,
at_exit, Rack review, simple routing - Part II: Test-drive the creation of our new, organized SinatraClone library
- Part III: Creating
#request,#response,#paramshelpers and theResponderclass - Part IV: Make helpers unique to each app, add Rack middleware support, review offline updates
- Part V: TBA - I hope to create more someday, I have lots of implementation ideas :)
Notes
Once this series is complete, we should end up with a gem that, ideally, can be used as a drop-in replacement for Sinatra. But does that mean you should use it? This series of screencasts is created for learning … specifically to show people how easy it is to write libraries like Sinatra. That said … I don’t expect anyone to actually use this library, once it’s been created!
Also, I never look at the source code for Sinatra for this series - where would be the fun in that? Everything we implement is fresh (or totally rotten). Reinventing the wheel isn’t very practical unless you’re trying to learn howto invent a wheel, yourself.
Enjoy!