File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1818end
1919
2020# Render a compiled template with the given context
21- LiquidSpec . render do |template , ctx |
22- static_registers = ctx . registers
23- registers = Liquid ::Registers . new ( static_registers )
21+ # @param template [Liquid::Template] compiled template
22+ # @param assigns [Hash] environment variables
23+ # @param options [Hash] :registers, :strict_errors, :exception_renderer
24+ LiquidSpec . render do |template , assigns , options |
25+ registers = Liquid ::Registers . new ( options [ :registers ] || { } )
2426
2527 context = Liquid ::Context . build (
26- static_environments : ctx . environment ,
28+ static_environments : assigns ,
2729 registers : registers ,
28- rethrow_errors : ctx . rethrow_errors? ,
30+ rethrow_errors : options [ :strict_errors ] ,
2931 )
3032
31- context . exception_renderer = ctx . exception_renderer if ctx . exception_renderer
33+ context . exception_renderer = options [ : exception_renderer] if options [ : exception_renderer]
3234
3335 template . render ( context )
3436end
You can’t perform that action at this time.
0 commit comments