1+ # encoding: utf-8
2+
13class ChunkWriter
24 def initialize ( output_dir , miss_templates , file_size = 640 *1000 , block_size = 64 )
35 @@output_dir = output_dir
@@ -12,7 +14,7 @@ def prepare_chunk(chunks, include_newline)
1214 end . join ( "" )
1315 end
1416
15- def write_files ( filename , start1 , repeat1 , end1 , repeat2 : '' , include_newline : true )
17+ def write_files ( filename , start1 , repeat1 , end1 , repeat2 = '' , include_newline = true )
1618 start1 = prepare_chunk ( start1 , include_newline )
1719 repeat1 = prepare_chunk ( repeat1 , include_newline )
1820 end1 = prepare_chunk ( end1 , include_newline )
@@ -87,8 +89,8 @@ def write_chunks(file, start1, repeat1, end1, size)
8789miss_templates = File . expand_path ( "miss-templates" , File . dirname ( __FILE__ ) )
8890Dir . mkdir ( output_dir ) unless File . directory? ( output_dir )
8991w = ChunkWriter . new ( output_dir , miss_templates )
90- w . write_files "utf-8" , '["֏","֏",{}' , ',"֏","֏",{}' , ',"֏","֏","֏"]' , repeat2 : ',"ab","ab",{}'
91- w . write_files "escape" , '["\\"","\\"",{}' , ',"\\"","\\"",{}' , ',"\\"","\\"","\\""]' , repeat2 : ',"ab","ab",{}'
92+ w . write_files "utf-8" , '["֏","֏",{}' , ',"֏","֏",{}' , ',"֏","֏","֏"]' , ',"ab","ab",{}'
93+ w . write_files "escape" , '["\\"","\\"",{}' , ',"\\"","\\"",{}' , ',"\\"","\\"","\\""]' , ',"ab","ab",{}'
9294w . write_files "0-structurals" , '"ab"' , '' , ''
9395# w.write_files "1-structurals", [ '[', '"ab"' ], [ ',', '"ab"' ], [ ',', '{', '}', ']' ]
9496# w.write_files "2-structurals", '["ab"', ',"ab"', [',{', '}]']
0 commit comments