lib/vedeu/renderers/html.rb in vedeu-0.7.4 vs lib/vedeu/renderers/html.rb in vedeu-0.8.0

- old
+ new

@@ -34,11 +34,11 @@ # # @return [String] def clear @output = Vedeu::Cells::Escape.new - '' + ''.freeze end # @param output [Vedeu::Models::Page] # @return [String] def render(output) @@ -47,18 +47,18 @@ super(Vedeu::Templating::Template.parse(self, template)) unless escape? end # @return [String] def html_body - return '' if output.is_a?(Vedeu::Cells::Escape) + return ''.freeze if output.is_a?(Vedeu::Cells::Escape) out = '' output.each do |line| - out << "#{start_row_tag}\n" + out << "#{start_row_tag}\n".freeze line.each { |char| out << char.to_html(options) } - out << "#{end_row_tag}\n" + out << "#{end_row_tag}\n".freeze end out.freeze end @@ -106,24 +106,24 @@ # The default values for a new instance of this class. # # @return [Hash<Symbol => void>] def defaults { - content: '', - end_tag: '</td>', - end_row_tag: '</tr>', - filename: 'out', - start_tag: '<td', - start_row_tag: '<tr>', + content: ''.freeze, + end_tag: '</td>'.freeze, + end_row_tag: '</tr>'.freeze, + filename: 'out'.freeze, + start_tag: '<td'.freeze, + start_row_tag: '<tr>'.freeze, template: default_template, timestamp: false, write_file: true, } end # @return [String] def default_template - ::File.dirname(__FILE__) + '/../templates/html_renderer.vedeu' + ::File.dirname(__FILE__) + '/../templates/html_renderer.vedeu'.freeze end end # HTML end # Renderers