Sha256: 899b5ac0b3ebe60592dca80f5ba156a04f093c6a99f3fe7238ced27786f3ce12

Contents?: true

Size: 878 Bytes

Versions: 2

Compression:

Stored size: 878 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(Rack::File.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

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-2011.10.23 lib/ramaze/middleware_compiler.rb
ramaze-2011.07.25 lib/ramaze/middleware_compiler.rb