rack-xslview 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/rack-xslview.rb +9 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/rack-xslview.rb
CHANGED
@@ -38,12 +38,19 @@ module Rack
|
|
38
38
|
return original_response if myxml.empty?
|
39
39
|
|
40
40
|
# Should XSL file be reloaded?
|
41
|
-
|
41
|
+
if @options[:reload] == true
|
42
42
|
@xslt = XML::XSLT.new()
|
43
43
|
@xslt.xsl = REXML::Document.new @options[:xslfile]
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
unless @options[:tidy].nil?
|
47
|
+
require 'tidy_ffi'
|
48
|
+
input_xml = myxml.include?('http://www.w3.org/1999/xhtml') ? 0 : 1
|
49
|
+
output = myxml.include?('http://www.w3.org/1999/xhtml') ? 'output_xhtml' : 'output_xml'
|
50
|
+
@options[:tidy][:input_xml] = input_xml
|
51
|
+
@options[:tidy][output.to_sym] = 1
|
52
|
+
myxml = TidyFFI::Tidy.new(myxml, @options[:tidy]).clean
|
53
|
+
end
|
47
54
|
@xslt.xml = myxml
|
48
55
|
|
49
56
|
# If setup includes env vars to pass through as params, do so
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 4
|
9
|
+
version: 0.2.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Albert Lash
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-24 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|