Class: Dokkit::Filter::Tidy

Inherits:
Object
  • Object
show all
Defined in:
lib/dokkit/filters/tidy.rb

Instance Method Summary collapse

Instance Method Details

#filter(text) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/dokkit/filters/tidy.rb', line 16

def filter(text)
  cmd = "tidy -q -i"
  out = IO.popen(cmd, 'r+') do |tidy|
    tidy.write text
    tidy.close_write
    tidy.read
  end
end