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.
@@ -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
- html = ""
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
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'spec'
2
3
  require 'rack/builder'
3
4
  require 'rack/mock'
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.1
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-05-04 00:00:00 -07:00
12
+ date: 2009-06-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15