Class: Richard::Internal::XmlFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/richard_iii/internal/xml_format.rb

Class Method Summary collapse

Class Method Details

.pretty(text) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/richard_iii/internal/xml_format.rb', line 5

def pretty(text)
  require 'nokogiri'
    
  doc = Nokogiri.XML(text) do |config|
    config.default_xml.noblanks
  end

  doc.to_xml(:indent => 2).lines.drop(1)
end