Class: Wolverine::Script::TemplateContext
- Inherits:
-
Object
- Object
- Wolverine::Script::TemplateContext
- Defined in:
- lib/wolverine/script.rb
Class Method Summary collapse
-
.include_partial(relative_path) ⇒ Object
helper method to include a lua partial within another lua script.
- .template(pathname) ⇒ Object
Class Method Details
.include_partial(relative_path) ⇒ Object
helper method to include a lua partial within another lua script
94 95 96 |
# File 'lib/wolverine/script.rb', line 94 def self.include_partial(relative_path) template( Pathname.new("#{Wolverine.config.script_path}/#{relative_path}") ) end |
.template(pathname) ⇒ Object
86 87 88 |
# File 'lib/wolverine/script.rb', line 86 def self.template(pathname) ERB.new(File.read(pathname)).result binding end |