Class: Ramaze::Files
- Inherits:
-
Object
- Object
- Ramaze::Files
- Defined in:
- lib/ramaze/files.rb
Overview
Class that makes it possible to easily use multiple public directories in your Ramaze application.
Instance Method Summary collapse
-
#<<(path) ⇒ Object
Adds a new path to the list of root directories.
-
#call(env) ⇒ Object
Allows this class to be called as a Rack middleware.
-
#initialize(*roots) ⇒ Files
constructor
Creates a new instance of the class, stores the given root directories and syncs the changes with Rack::Cascade.
-
#sync ⇒ Object
Syncs the class with Rack::Cascade.
Constructor Details
Instance Method Details
#<<(path) ⇒ Object
Adds a new path to the list of root directories.
42 43 44 45 46 |
# File 'lib/ramaze/files.rb', line 42 def <<(path) @roots << File.(path.to_s) @roots.uniq! sync end |
#call(env) ⇒ Object
Allows this class to be called as a Rack middleware.
31 32 33 |
# File 'lib/ramaze/files.rb', line 31 def call(env) @cascade.call(env) end |