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

#include_path_in_idObject

Returns the value of attribute include_path_in_id.



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

def include_path_in_id
  @include_path_in_id
end

#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_classObject

Returns the value of attribute template_base_class.



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

def template_base_class
  @template_base_class
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

#template_cacheObject

Returns the value of attribute template_cache.



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

def template_cache
  @template_cache
end

#template_extensionObject

Returns the value of attribute template_extension.



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

def template_extension
  @template_extension
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



68
69
70
# File 'lib/stache/config.rb', line 68

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