devbar 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/devbar/version.rb +1 -1
- data/lib/devbar.rb +13 -6
- metadata +2 -2
data/lib/devbar/version.rb
CHANGED
data/lib/devbar.rb
CHANGED
@@ -7,15 +7,22 @@ module Rack
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def call(env)
|
10
|
-
status, headers,
|
10
|
+
status, headers, body = @app.call(env)
|
11
|
+
return [status, headers, response] unless headers['Content-Type'] =~ /html/
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
body.each do |part|
|
14
|
+
if part =~ /<\/body>/
|
15
|
+
part.sub!(/<\/body>/, "#{bar}</body>")
|
16
|
+
|
17
|
+
if headers['Content-Length']
|
18
|
+
headers['Content-Length'] = (headers['Content-Length'].to_i + bar.length).to_s
|
19
|
+
end
|
20
|
+
|
21
|
+
break
|
22
|
+
end
|
16
23
|
end
|
17
24
|
|
18
|
-
[status, headers,
|
25
|
+
[status, headers, body]
|
19
26
|
end
|
20
27
|
|
21
28
|
def bar
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! ' Rack middleware to output a bar showing environment '
|
15
15
|
email:
|