Class: Wolverine::Script::TemplateContext

Inherits:
Object
  • Object
show all
Defined in:
lib/wolverine/script.rb

Class Method Summary collapse

Class Method Details

.include_partial(relative_path) ⇒ Object

helper method to include a lua partial within another lua script

Parameters:

  • relative_path (String)

    the relative path to the script from ‘Wolverine.config.script_path`



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