Sha256: e282fbe917f8c3f0b61d0d9e7a6e39064bee66f5d7a5e6fc5c9d8e876254938d

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require 'glue/attribute'
require 'glue/configuration'
require 'glue/sweeper'

require 'nitro/caching/output'
require 'nitro/caching/actions'
require 'nitro/caching/fragments'

module Nitro

# Nitro Hierarchical Caching system.
#
# # Output caching (caches the whole page, main action)
# # Action caching (cache the fragment generated by an action)
# # Fragment caching (fine-grained fragment caching, cache snippets of code) 
#--
# TODO: add per controller caching_enabled.
#++

module Caching

  # Globaly enable/disable caching.
  
  setting :caching_enabled, :default => true, :doc => 'Globaly enable/disable caching'
  
  def self.included(base) #:nodoc:
    base.send :include, Output, Actions, Fragments
    base.module_eval do
#      @caching_enabled = true
      def self.caching_enabled?
        Caching.caching_enabled # and @caching_enabled
      end

      private 
      
      def caching_enabled?
        Caching.caching_enabled # and self.class.get_instance_variable(:caching_enabled)
      end
    end
  end
end

end

# * George Moschovitis <gm@navel.gr>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nitro-0.29.0 lib/nitro/caching.rb
nitro-0.28.0 lib/nitro/caching.rb
nitro-0.30.0 lib/nitro/caching.rb