threedaymonk/htmlbeautifier — pull request #10 by jirutka (2014-10-16 00:22:54+00:00)
Title: Add a convenient method HtmlBeautifier.beautify

The current API is IMHO quite weird and inconvenient for the most common use case – just take HTML in String and return it in a prettier shape, also as String. This should be one-line, not three lines in a procedural feel.

```ruby
output = []
Beautifier.new(output).scan(input)
output.join
```

I’ve added a shorthand method `beautify` to `HtmlBeautifier` module that does exactly that — and also call `to_html` method on the given input, when it responds to it (e.g. Nokogiri node).