Sha256: 460fd18be5e8b147bd0c094c588888f53435050bf1222e47154e2b09f2d48070

Contents?: true

Size: 839 Bytes

Versions: 2

Compression:

Stored size: 839 Bytes

Contents

require 'nitro/helper/url'
require 'nitro/caching/output'

module Nitro

module Caching

# A proxy to the caching system. This is typically used from the
# console.
#--
# gmosx: If anyone can suggest a better name, please speak up!
#++

class Proxy
  extend URLHelper
  extend Output
  
  class << self
  
    def cleanup_output
      dirs = {}
      
      for ctrl, a in Nitro::Caching::Output.cached_actions 
        file = encode_url(ctrl, a)
        
        file << 'index' if file == '/'

        unless dirs[file]
          puts "Expiring cache directory '#{file}'"
          expire_output(file)
          dirs[file] = true
        end

        file << '.html'
        puts "Expiring cache file '#{file}'"
        expire_output(file)
      end
   
      return true
    end
    alias cleanup cleanup_output
  
  end

end

end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.41.0 lib/nitro/caching/proxy.rb
nitro-0.40.0 lib/nitro/caching/proxy.rb