Sha256: d04eed3a480b5a5438a7ec52f817ced4015575c467cf9d168949c4d1ce6a3fae

Contents?: true

Size: 510 Bytes

Versions: 2

Compression:

Stored size: 510 Bytes

Contents

module Catche
  module Expire
    module Page

      class << self

        # Expires cache by deleting the associated files
        # Uses the same flow as defined in `expire_page` in ActionController
        #
        #   Catche::Expire::Page.expire!('/public/projects.html')
        def expire!(*paths)
          paths.each do |path|
            File.delete(path) if File.exist?(path)
            File.delete(path + '.gz') if File.exist?(path + '.gz')
          end
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
catche-0.2.3 lib/catche/expire/page.rb
catche-0.2.2 lib/catche/expire/page.rb