Class: Tilt::SigilTemplate
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sigil.rb
Overview
Standalone string interpolator and template processor implementation in Go. see: github.com/gliderlabs/sigil
Instance Attribute Summary
Attributes inherited from Template
Instance Method Summary collapse
Methods inherited from Template
#basename, default_mime_type, default_mime_type=, #eval_file, #initialize, metadata, #metadata, #name, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Instance Method Details
#allows_script? ⇒ Boolean
30 31 32 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sigil.rb', line 30 def allows_script? false end |
#evaluate(scope, locals, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sigil.rb', line 11 def evaluate(scope, locals, &block) variables = locals.map {|k, v| "#{k}=#{v}" } cmd = ['sigil'] unless variables.empty? cmd << '-p' cmd.concat(variables) end out, err, status = Open3.capture3(*cmd, :stdin_data => data) if status.success? out.chomp else raise err.chomp.gsub('<stdin>', file) end end |
#prepare ⇒ Object
8 9 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sigil.rb', line 8 def prepare end |