Sha256: ecdb6d3df93b8fb3d5f7175b79da68d0aa4ec837b3ee8157976c1e924360bcf4

Contents?: true

Size: 826 Bytes

Versions: 5

Compression:

Stored size: 826 Bytes

Contents

module Stache
  # 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')
  # end
  module Config
    attr_accessor :template_base_path, :template_extension, :shared_path
    
    def configure
      yield self
    end
    
    
    def template_base_path
      @template_base_path ||= ::Rails.root.join('app', 'templates')
    end
    
    def template_base_path= path
      @template_base_path = Pathname.new(path)
    end

    def template_extension
      @template_extension ||= 'html.mustache'
    end

    def shared_path
      @shared_path ||= ::Rails.root.join('app', 'templates', 'shared')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stache-0.2.2 lib/stache/config.rb
stache-0.2.1 lib/stache/config.rb
stache-0.2.0 lib/stache/config.rb
stache-0.1.0 lib/stache/config.rb
stache-0.0.3 lib/stache/config.rb