diff --git a/lib/lrama/output.rb b/lib/lrama/output.rb index eaefbd04..696aa79f 100644 --- a/lib/lrama/output.rb +++ b/lib/lrama/output.rb @@ -53,9 +53,7 @@ def render if @header_out @header_out << tmp else - File.open(@header_file_path, "w+") do |f| - f << tmp - end + File.write(@header_file_path, tmp) end end end diff --git a/spec/lrama/output_spec.rb b/spec/lrama/output_spec.rb index 90b84506..4afae322 100644 --- a/spec/lrama/output_spec.rb +++ b/spec/lrama/output_spec.rb @@ -10,7 +10,7 @@ header_out: header_out, header_file_path: "y.tab.h", context: context, - grammar: grammar, + grammar: grammar, ) } let(:out) { StringIO.new }