We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
JSON.load_file
1 parent fc25fdc commit b387a21Copy full SHA for b387a21
templatescompiler/erbrenderer/erb_renderer.rb
@@ -177,7 +177,8 @@ def render(src_path, dst_path)
177
erb = ERB.new(File.read(src_path), trim_mode: "-")
178
erb.filename = src_path
179
180
- context_hash = JSON.load_file(@json_context_path)
+ # Note: JSON.load_file was added in v2.3.1: https://github.com/ruby/json/blob/v2.3.1/lib/json/common.rb#L286
181
+ context_hash = JSON.parse(File.read(@json_context_path))
182
template_evaluation_context = TemplateEvaluationContext.new(context_hash)
183
184
File.write(dst_path, erb.result(template_evaluation_context.get_binding))
0 commit comments