Permalink
Browse files

change ppxml to return instead of puts

  • Loading branch information...
1 parent a4382e2 commit 031a9a1a69a6fbe7982369838116493e438447b5 @levity committed May 2, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 ppxml.rb
View
@@ -1,10 +1,10 @@
# http://emmanueloga.wordpress.com/2009/09/29/pretty-printing-xhtml-with-nokogiri-and-xslt/
-require 'nokogiri'
+require 'nokogiri' unless defined? Rails
-class PPXML
- def self.pp(nokogiri_doc)
- puts Nokogiri::XSLT(XSL).apply_to(nokogiri_doc).to_s
+class PPXML
+ def self.pretty(nokogiri_doc)
+ Nokogiri::XSLT(XSL).apply_to(nokogiri_doc).to_s
end
XSL = <<-EOXSL

0 comments on commit 031a9a1

Please sign in to comment.