1
+ # encoding: utf-8
2
+
1
3
class ChunkWriter
2
4
def initialize ( output_dir , miss_templates , file_size = 640 *1000 , block_size = 64 )
3
5
@@output_dir = output_dir
@@ -12,7 +14,7 @@ def prepare_chunk(chunks, include_newline)
12
14
end . join ( "" )
13
15
end
14
16
15
- def write_files ( filename , start1 , repeat1 , end1 , repeat2 : '' , include_newline : true )
17
+ def write_files ( filename , start1 , repeat1 , end1 , repeat2 = '' , include_newline = true )
16
18
start1 = prepare_chunk ( start1 , include_newline )
17
19
repeat1 = prepare_chunk ( repeat1 , include_newline )
18
20
end1 = prepare_chunk ( end1 , include_newline )
@@ -87,8 +89,8 @@ def write_chunks(file, start1, repeat1, end1, size)
87
89
miss_templates = File . expand_path ( "miss-templates" , File . dirname ( __FILE__ ) )
88
90
Dir . mkdir ( output_dir ) unless File . directory? ( output_dir )
89
91
w = 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",{}'
92
94
w . write_files "0-structurals" , '"ab"' , '' , ''
93
95
# w.write_files "1-structurals", [ '[', '"ab"' ], [ ',', '"ab"' ], [ ',', '{', '}', ']' ]
94
96
# w.write_files "2-structurals", '["ab"', ',"ab"', [',{', '}]']
0 commit comments