Sha256: bc9c791b1b161521f9f6cf75ed58bf5977823b7a70f0a3bdfad6003ee89ceda2

Contents?: true

Size: 879 Bytes

Versions: 2

Compression:

Stored size: 879 Bytes

Contents

require 'fileutils'

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

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

module Nitro

# Adds support for caching.
#--
# TODO: add per controller caching_enabled.
#++

module Caching

  # Globaly enable/disable caching.
  
  setting :caching_enabled, :default => true, :doc => 'Globaly enable/disable caching'
  
  def self.append_features(base) #:nodoc:
    super
    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

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.24.0 lib/nitro/caching.rb
nitro-0.25.0 lib/nitro/caching.rb