Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog post on Rack code reading #11

Open
agis opened this issue May 31, 2012 · 4 comments
Open

Blog post on Rack code reading #11

agis opened this issue May 31, 2012 · 4 comments

Comments

@agis
Copy link

agis commented May 31, 2012

Fellow code readers, I've started a blog some days ago and I've decided it would be a good place to sum up what I've learned from our code reading session on Rack.

I haven't shared it yet, I wanted first to share it with fellow @codereading/readers so I can get opinions/corrections/general feedback etc.

I've also put a credits section in the beggining since some of the sentences are actually taken from our Issues tracker.

http://agis.heroku.com/blog/2012/05/31/hands-on-rack/

@samnang
Copy link
Member

samnang commented Jun 1, 2012

Well done, I think it's a very good wrap up of the topic. One thing I notice of your code snippet to explain how Rack package and run Middlewares which use Class object(Middleware) instead of using objects that were instantiated. Here what I think it should be:

yo_middleware = YoMiddleware.new(OurApp) # iteration 1
another_middleware = AnotherMiddleware.new(yo_middleware) # iteration 2
cool_middleware = CoolMiddleware.new(another_middleware) # iteration 3

@agis
Copy link
Author

agis commented Jun 1, 2012

Right. Fixed that. I wonder what @skade thinks about this. I think he's in EuRuKo atm.

@skade
Copy link

skade commented Jun 1, 2012

One minor nitpick about the first code sample:

{"Content-Type" => "text/plain"}

Content-Length is a mandatory header on fixed-length responses. If you use the Rack::Lint middleware, it will fail.

Otherwise, good post!

@adamakhtar
Copy link
Member

hi @agis , Sorry but ive only just discovered this post of yours but great work! Thanks for the write up and hope the code reading projects continue to help you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants