Sha256: 584428edb92b153be8279e597712ed0ff6e2e00e7ad5543c3edf5e2210f30dd1

Contents?: true

Size: 743 Bytes

Versions: 2

Compression:

Stored size: 743 Bytes

Contents

module Rack::App::FrontEnd::SingletonMethods

  def mount_folder(folder_path)
    Rack::App::FrontEnd::FolderMounter.new(self).mount(Rack::App::Utils.expand_path(folder_path))
  end

  alias mount_templates_from mount_folder

  def layout(layout_path=nil)
    @layout = Rack::App::Utils.expand_path(layout_path) unless layout_path.nil?
    @layout
  end

  def precache_templates(*template_paths)
    full_paths = template_paths.map { |path| Rack::App::Utils.expand_path(path) }
    full_paths.each do |full_path|
      Rack::App::FrontEnd::Template.cache.fetch(full_path) { Tilt.new(full_path) }
    end
    nil
  end

  def helpers(&block)
    @helpers ||= Module.new
    @helpers.class_eval(&block) unless block.nil?
    @helpers
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-app-front_end-0.13.0 lib/rack/app/front_end/singleton_methods.rb
rack-app-front_end-0.12.0 lib/rack/app/front_end/singleton_methods.rb