Sha256: 951c0e2410de0d784b5a5368ac665f2c031819bc6f47fa63d19f3dd8016fdd42

Contents?: true

Size: 964 Bytes

Versions: 5

Compression:

Stored size: 964 Bytes

Contents

require 'fileutils'
require 'padrino-core'
require 'padrino-helpers'
FileSet.glob_require('padrino-cache/{helpers}/*.rb', __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

5 entries across 5 versions & 1 rubygems

Version Path
padrino-cache-0.9.24 lib/padrino-cache.rb
padrino-cache-0.9.23 lib/padrino-cache.rb
padrino-cache-0.9.22 lib/padrino-cache.rb
padrino-cache-0.9.21 lib/padrino-cache.rb
padrino-cache-0.9.20 lib/padrino-cache.rb