rack-mini-profiler 0.1.6 → 0.1.11.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rack-mini-profiler might be problematic. Click here for more details.

@@ -1,45 +0,0 @@
1
- module Rack
2
- class MiniProfiler
3
-
4
- # This class acts as a proxy to the Body so that we can
5
- # safely append to the end without knowing about the internals
6
- # of the body class.
7
- class BodyAddProxy
8
- def initialize(body, additional_text)
9
- @body = body
10
- @additional_text = additional_text
11
- end
12
-
13
- def respond_to?(*args)
14
- super or @body.respond_to?(*args)
15
- end
16
-
17
- def method_missing(*args, &block)
18
- @body.__send__(*args, &block)
19
- end
20
-
21
- # In the case of to_str we don't want to use method_missing as it might avoid
22
- # a call to each (such as in Rack::Test)
23
- def to_str
24
- result = ""
25
- each {|token| result << token}
26
- result
27
- end
28
-
29
- def each(&block)
30
-
31
- # In ruby 1.9 we don't support String#each
32
- if @body.is_a?(String)
33
- yield @body
34
- else
35
- @body.each(&block)
36
- end
37
-
38
- yield @additional_text
39
- self
40
- end
41
-
42
- end
43
-
44
- end
45
- end