Class: Sherb
- Inherits:
-
ERB
- Object
- ERB
- Sherb
- Defined in:
- lib/sherb.rb
Instance Attribute Summary collapse
-
#sourcename ⇒ Object
Returns the value of attribute sourcename.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#sourcename ⇒ Object
Returns the value of attribute sourcename.
4 5 6 |
# File 'lib/sherb.rb', line 4 def sourcename @sourcename end |
Class Method Details
.new_with_source(template, sourcename) ⇒ Object
6 7 8 9 10 |
# File 'lib/sherb.rb', line 6 def self.new_with_source(template, sourcename) erb = self.new(template) erb.sourcename = sourcename erb end |
Instance Method Details
#execute! ⇒ Object
23 24 25 |
# File 'lib/sherb.rb', line 23 def execute! IO.popen('/bin/bash', 'w') {|io| io.puts rendered_script } end |
#rendered_script ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sherb.rb', line 12 def rendered_script rendered_script = result rescue Exception => e if self.sourcename e.backtrace.each_with_index do |stack_line, line_number| e.backtrace[line_number].gsub!(/^\(erb\):/, "#{sourcename}:") end end raise end |