Remove code duplication for Rack middleware #272

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

omerisimo commented Mar 6, 2014

Browsing through the code in an attempt to understand the logic for sending notifications I found that Airbrake::Rack and Airbrake::Rails::Middleware classes had a lot of common logic.
This made the code hard to follow and understand the differences between the two implementations.

This pull request makes the code of the two classes DRY :) [Don't Repeat Yourself]
All tests are passing, and I have performed some manual testing to make sure the full integration works well in both Rails 3.2 and Sinatra.

@omerisimo omerisimo Remove code duplication for Rack middleware
Airbrake::Rack and Airbrake::Rails::Middleware code is now DRY
10f7feb
Owner

kyrylo commented Aug 19, 2015

Hi! I appreciate your work, but this looks outdated now :(

I would go for composition instead of inheritance, since this line class Middleware < Airbrake::Rack doesn't seem to be logical for me.

I couldn't find an explanation of why some methods are private and others are protected.

If you're still interested, feel free to open a new PR.

kyrylo closed this Aug 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment