lib/unparser/writer/dynamic_string.rb in unparser-0.5.5 vs lib/unparser/writer/dynamic_string.rb in unparser-0.5.6

- old
+ new

@@ -40,11 +40,11 @@ end private def heredoc_header - need_squiggly? ? '<<~HEREDOC' : '<<-HEREDOC' + '<<-HEREDOC' end def heredoc? !children.empty? && (nl_last_child? && heredoc_pattern?) end @@ -53,15 +53,11 @@ write(heredoc_header) end def emit_heredoc_body nl - if need_squiggly? - emit_squiggly_heredoc_body - else - emit_normal_heredoc_body - end + emit_normal_heredoc_body end def emit_heredoc_footer write('HEREDOC') end @@ -115,13 +111,9 @@ end def nl_last_child? last = children.last n_str?(last) && last.children.first[-1].eql?("\n") - end - - def need_squiggly? - children.any?(s(:str, '')) end def emit_squiggly_heredoc_body buffer.indent children.each do |child|