Module: Stache::Config

Included in:
Stache
Defined in:
lib/stache/config.rb

Overview

Change these defaults in, say, an initializer.

Stache.template_base_path = Rails.root.join(‘app’, ‘templates’)

Or with the block syntax:

Stache.configure do |config|

config.template_base_path = Rails.root.join('app', 'views', 'shared')

use :mustache # or :handlebars

end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#shared_pathObject

Returns the value of attribute shared_path.



14
15
16
# File 'lib/stache/config.rb', line 14

def shared_path
  @shared_path
end

#template_base_pathObject

Returns the value of attribute template_base_path.



14
15
16
# File 'lib/stache/config.rb', line 14

def template_base_path
  @template_base_path
end

#wrapper_module_nameObject

Returns the value of attribute wrapper_module_name.



14
15
16
# File 'lib/stache/config.rb', line 14

def wrapper_module_name
  @wrapper_module_name
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



16
17
18
# File 'lib/stache/config.rb', line 16

def configure
  yield self
end

#use(template_engine) ⇒ Object



36
37
38
# File 'lib/stache/config.rb', line 36

def use template_engine
  require "stache/#{template_engine}"
end