Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rack_timer/stack.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ActionDispatch
class MiddlewareStack < Array
class MiddlewareStack

# this class will wrap around each Rack-based middleware and take timing snapshots of how long
# each middleware takes to execute
Expand Down Expand Up @@ -70,7 +70,7 @@ def build(app)
def build(app = nil, &block)
app ||= block
raise "MiddlewareStack#build requires an app" unless app
reverse.inject(RackTimer.new(app)) { |a, e| e.build(a) }
self.to_a.reverse.inject(RackTimer.new(app)) { |a, e| e.build(a) }
end

end
Expand Down