Sha256: b49f6c20471b1901e425411f8318518009391a67f2773f15623f6d7933d76daa

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

require 'fileutils'
require 'padrino-core'
require 'padrino-helpers'
#FileSet.glob_require('padrino-cache/{helpers}/*.rb', __FILE__)
Dir.glob(File.dirname(__FILE__) + '/padrino-cache/helpers/*.rb') {|file| require file}

module Padrino
  module Cache
    ##
    # Register these helpers:
    #
    #   Padrino::Cache::FragmentHelpers
    #   Padrino::Cache::PageHelpers
    #
    # for Padrino::Application
    #

    autoload :Store, 'padrino-cache/store'

    class << self
      def registered(app)
        app.helpers Padrino::Cache::Helpers::CacheStore
        app.helpers Padrino::Cache::Helpers::Fragment
        app.helpers Padrino::Cache::Helpers::Page
        app.set :cache_store, Padrino::Cache::Store::File.new(File.join(app.root, 'tmp', 'cache'))
        app.disable :caching
      end
      alias :included :registered

      def padrino_route_added(route, verb, path, args, options, block)
        Padrino::Cache::Helpers::Page.padrino_route_added(route, verb, path, args, options, block)
      end
    end
  end # Helpers
end # Padrino

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
padrino-cache-0.9.19 lib/padrino-cache.rb
padrino-cache-0.9.18 lib/padrino-cache.rb
padrino-cache-0.9.17 lib/padrino-cache.rb
padrino-cache-0.9.16 lib/padrino-cache.rb