rack-xslview 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/rack-xslview.rb +9 -2
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -38,12 +38,19 @@ module Rack
38
38
  return original_response if myxml.empty?
39
39
 
40
40
  # Should XSL file be reloaded?
41
- unless @options[:reload] == true
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
- # Set XML for stylesheet
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
- - 3
9
- version: 0.2.3
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-22 00:00:00 -04:00
17
+ date: 2010-05-24 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency