Class: Ramaze::MiddlewareCompiler

Inherits:
Innate::MiddlewareCompiler
  • Object
show all
Defined in:
lib/ramaze/middleware_compiler.rb

Overview

See Also:

Author:

Since:

Instance Method Summary (collapse)

Instance Method Details

- (Object) directory(path)

Adds the path as a directory.

Parameters:

  • path (String)

    The path to the directory to add.

Author:

  • Michael Fellinger

Since:

  • 26-03-2009



29
30
31
32
33
34
# File 'lib/ramaze/middleware_compiler.rb', line 29

def directory(path)
  require 'rack/contrib'
  Rack::ETag.new(
    Rack::ConditionalGet.new(Rack::Directory.new(path)), 'public'
  )
end

- (Object) static(path)

Adds the path as a static file.

Parameters:

  • path (String)

    The path to the static file to add.

Author:

  • Michael Fellinger

Since:

  • 26-03-2009



15
16
17
18
19
20
# File 'lib/ramaze/middleware_compiler.rb', line 15

def static(path)
  require 'rack/contrib'
  Rack::ETag.new(
    Rack::ConditionalGet.new(Rack::File.new(path)), 'public'
  )
end