From e14440e544be79d857f77dee2598ed98a8a6b59f Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 6 Oct 2014 03:08:25 +0000 Subject: unicode_norm_gen.rb: freeze * tool/unicode_norm_gen.rb: freeze strings and tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/unicode_norm_gen.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tool') diff --git a/tool/unicode_norm_gen.rb b/tool/unicode_norm_gen.rb index 7fceaefb03..2253b9685a 100644 --- a/tool/unicode_norm_gen.rb +++ b/tool/unicode_norm_gen.rb @@ -23,8 +23,8 @@ class Integer end class Array - def line_slice (new_line) # joins items, 16 items per line - each_slice(16).collect(&:join).join new_line + def line_slice(new_line) # joins items, 8 items per line + each_slice(8).collect(&:join).join(new_line).gsub(/ +$/, '') end def to_UTF8() collect(&:to_UTF8).join end @@ -53,7 +53,7 @@ end class Hash def to_hash_string collect do |key, value| - "\"#{key.to_UTF8}\"=>\"#{value.to_UTF8}\", " + "\"#{key.to_UTF8}\"=>\"#{value.to_UTF8}\".freeze, " end.line_slice "\n " end end @@ -143,7 +143,7 @@ open("#{OuputDataDir}/normalize_tables.rb", "w").print <