Skip to content

Commit 1e8a54a

Browse files
committed
Fix benchfeatures.rb on Ruby 1.9
1 parent aa53d87 commit 1e8a54a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jsonexamples/generated/genfeaturejson.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# encoding: utf-8
2+
13
class 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)
8789
miss_templates = File.expand_path("miss-templates", File.dirname(__FILE__))
8890
Dir.mkdir(output_dir) unless File.directory?(output_dir)
8991
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",{}'
9294
w.write_files "0-structurals", '"ab"', '', ''
9395
# w.write_files "1-structurals", [ '[', '"ab"' ], [ ',', '"ab"' ], [ ',', '{', '}', ']' ]
9496
# w.write_files "2-structurals", '["ab"', ',"ab"', [',{', '}]']

0 commit comments

Comments
 (0)