sickill-rack_revision_info 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack_revision_info.rb +5 -3
- data/spec/spec_rack_revision_info.rb +1 -0
- metadata +2 -2
data/lib/rack_revision_info.rb
CHANGED
@@ -19,11 +19,12 @@ module Rack
|
|
19
19
|
def call(env)
|
20
20
|
status, headers, body = @app.call(env)
|
21
21
|
if headers['Content-Type'].include?('text/html') && !Rack::Request.new(env).xhr?
|
22
|
+
html = ""
|
23
|
+
body.each { |s| html << s }
|
24
|
+
body = html
|
22
25
|
begin
|
23
26
|
if @action
|
24
|
-
|
25
|
-
body.each { |s| html << s }
|
26
|
-
doc = Hpricot(html)
|
27
|
+
doc = Hpricot(body)
|
27
28
|
elements = doc.search(@selector).compact
|
28
29
|
if elements.size > 0
|
29
30
|
elements = elements.first if @action == :swap
|
@@ -36,6 +37,7 @@ module Rack
|
|
36
37
|
puts e.backtrace
|
37
38
|
end
|
38
39
|
body << %(\n<!-- #{@revision_info} -->\n)
|
40
|
+
body = [body]
|
39
41
|
end
|
40
42
|
[status, headers, body]
|
41
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sickill-rack_revision_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Kulik
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|