Class: Codestrap::Stub::Standard
- Defined in:
- lib/codestrap/stub/standard.rb
Overview
Standard file (erb) render
Instance Attribute Summary
Attributes inherited from Abstract
#dst, #file, #objects, #overwrite, #src
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(*args) ⇒ Standard
constructor
A new instance of Standard.
- #pre ⇒ Object
Methods inherited from Abstract
#abstract, abstract_methods, #overwrite?, #post, #to_disk
Constructor Details
#initialize(*args) ⇒ Standard
Returns a new instance of Standard.
8 9 |
# File 'lib/codestrap/stub/standard.rb', line 8 def initialize(*args) end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 |
# File 'lib/codestrap/stub/standard.rb', line 16 def execute ns = Codestrap::Namespace.new(@objects.objects) file.write @erb.result(ns.get_binding) file.close end |
#pre ⇒ Object
11 12 13 14 |
# File 'lib/codestrap/stub/standard.rb', line 11 def pre @erb = ERB.new(File.read(self.src)) @erb.filename = self.src end |