Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 3.49 KB

File metadata and controls

96 lines (62 loc) · 3.49 KB

Rack, Roda, and Ruby

Rails is just a callable. Sinatra is just a callable. So is Roda. This book strips away the magic of Ruby web development, shows you exactly what Rack is doing under the hood, and teaches you to build from first principles. Know your tools. Really know them.

A CloudStreet book.

Read online: https://cloudstreet-dev.github.io/Rack-Roda-and-Ruby/


What This Is

You've been writing Ruby web applications. You understand routes, controllers, middleware, responses. You know how to use the framework. But do you know what the framework is? Do you know what happens before your code runs, or what "Rack compatibility" actually means, or why every Ruby web framework can be dropped into a config.ru?

This book answers those questions. It starts at the HTTP wire protocol, builds up through the Rack specification, constructs working servers and middleware from scratch, and then examines how Roda—one of the cleanest Ruby web frameworks—sits on top of all of it. By the end, you'll understand not just how to use these tools but why they are the way they are.

The code in this book actually runs. The explanations are accurate. The humor is dry.


Table of Contents

Introduction

Part I — The Foundation

Part II — Rack

Part III — Roda

Part IV — Patterns

Conclusion


Building Locally

You'll need mdBook installed:

cargo install mdbook

Then:

git clone https://github.com/cloudstreet-dev/Rack-Roda-and-Ruby
cd Rack-Roda-and-Ruby
mdbook serve --open

This starts a local server at http://localhost:3000 with live reloading.

To build a static copy:

mdbook build
# Output is in ./book/

License

This book is released under CC0 1.0 Universal — public domain. Take it, adapt it, use it in courses, translate it, whatever. Attribution is appreciated but not required.


Acknowledgements

Thank you to Georgiy Treyvus for coming up with the idea for this book.


The CloudStreet Series

This book is part of the CloudStreet series of technical books at github.com/cloudstreet-dev. The series covers practical Ruby, web fundamentals, and the kind of knowledge that makes you genuinely better rather than just more familiar with a particular framework's DSL.