presidentbeef/brakeman — pull request #441 by presidentbeef (2014-02-11 23:20:37+00:00)
Title: Fix HAML template processing

This fixes some issues with HAML template processing, in particular properly dealing with nested output.

For example, a template like this
```haml
#content
.nav
= @navigation_menu
```
is converted to Ruby like this
```ruby
_hamlout.push_text("

\n

\n #{_hamlout.adjust_tabs(2);

_hamlout.format_script_false_false_false_true_false_true_false(( @navigation_menu
));}\n

\n

\n", -2, false);
```
and would produce output like this in Brakeman
```
+-------------------------------------------------------------------------------------------------+
| Output |
+-------------------------------------------------------------------------------------------------+
| [Output] "

;

; #{[Escaped] @navigation_menu};

;

;" |
+-------------------------------------------------------------------------------------------------+
```
but now it will look like this instead
```
+-----------------------------------+
| Output |
+-----------------------------------+
| [Escaped Output] @navigation_menu |
+-----------------------------------+
```

Besides looking much nicer, this improves warnings and reduces how much code Brakeman has to search. Additionally, these `push_text` methods can often interpolate multiple values into the output string, which were not being properly detected as output. This is fixed now.