Sha256: bbf55ccd507e2982a2bba1dbcc1a9e8c7b54958f93a3ece55e095fb27e503c69

Contents?: true

Size: 883 Bytes

Versions: 3

Compression:

Stored size: 883 Bytes

Contents

module Ramaze
  ##
  # @author Michael Fellinger
  # @since  14-03-2009
  # @see    Innate::MiddelwareCompiler
  #
  class MiddlewareCompiler < Innate::MiddlewareCompiler
    ##
    # Adds the path as a static file.
    #
    # @author Michael Fellinger
    # @since  26-03-2009
    # @param  [String] path The path to the static file to add.
    #
    def static(path)
      require 'rack/contrib'
      Rack::ETag.new(
        Rack::ConditionalGet.new(RackFileWrapper.new(path)), 'public'
      )
    end

    ##
    # Adds the path as a directory.
    #
    # @author Michael Fellinger
    # @since  26-03-2009
    # @param  [String] path The path to the directory to add.
    #
    def directory(path)
      require 'rack/contrib'
      Rack::ETag.new(
        Rack::ConditionalGet.new(Rack::Directory.new(path)), 'public'
      )
    end
  end # MiddlewareCompiler
end # Ramaze

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ramaze-2012.04.14 lib/ramaze/middleware_compiler.rb
ramaze-2012.03.07 lib/ramaze/middleware_compiler.rb
ramaze-2011.12.28 lib/ramaze/middleware_compiler.rb