rewritten 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.3.3
2
+
3
+ * Possibly fixing new relic compatiblity: Only process successful responses in Rewritten::HTML
1
4
 
2
5
  == 0.3.1
3
6
 
data/lib/rack/html.rb CHANGED
@@ -11,20 +11,22 @@ module Rack
11
11
  end
12
12
 
13
13
  def call(env)
14
- puts "-> Rack::Rewritten::Html"
15
14
  req = Rack::Request.new(env)
16
15
  status, headers, response = @app.call(env)
17
16
 
18
- new_response = []
19
-
20
- response.each do |line|
21
- links = line.scan(/href="([^"]+)"/).uniq
22
- res = line
23
- links.each do |link|
24
- t = get_translation(link)
25
- res.gsub!(/href="#{link}"/, %Q|href="#{t}"|) if t
17
+ if status == 200
18
+ new_response = []
19
+ response.each do |line|
20
+ links = line.scan(/href="([^"]+)"/).flatten.uniq
21
+ res = line
22
+ links.each do |link|
23
+ t = get_translation(link)
24
+ res.gsub!(/href="#{link}"/, %Q|href="#{t}"|) if t
25
+ end
26
+ new_response << res
26
27
  end
27
- new_response << res
28
+ else
29
+ new_response = response
28
30
  end
29
31
 
30
32
  [status, headers, new_response]
@@ -1,4 +1,4 @@
1
1
  module Rewritten
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rewritten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
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-01-24 00:00:00.000000000 Z
12
+ date: 2013-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis-namespace