erniebrodeur/ruby-beautify — pull request #9 by veelenga (2014-12-14 20:04:31+00:00)
Title: Fixing defect with multi-line strings 

@erniebrodeur This is a fix of both issues #6 and #8. Please review carefully because it has a lot of changes.
As for me the root problem was flattening of content. This mutates multi-line string, because as you know:

````ruby
a = "line1
line2
line3"
````
not equal to
````ruby
a = "line1
line2
line3"
````

So I decided to refuse flattening and re-implemented some methods to proper analyze code.

To fix an issue with multi-line strings I have changed an algorithm of walking through lines. So now it looks like:

1. Walk through array of tokens (instead of lines)
2. Identify a bunch of tokens that represent **one line** and out it:
* Array of tokens is empty at the beginning
* Add next token (structure of [[lineno, column], type, token]) to the array
* If this token is not of type of new line, continue
* If this token has type of new line, process it, clear array and continue

At the end I added a bunch of tests. As for me it is good to add a file with expected output that is easier (than just a hex) to maintain. Now you can review what tests were added for just from the git hub.