Class: Rack::Cat
- Inherits:
-
Object
- Object
- Rack::Cat
- Defined in:
- lib/rack/cat.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Cat
constructor
A new instance of Cat.
Constructor Details
#initialize(app, options = {}) ⇒ Cat
Returns a new instance of Cat.
6 7 8 9 10 11 12 13 14 |
# File 'lib/rack/cat.rb', line 6 def initialize(app, = {}) @app = app @bundles = [:bundles] # { "/destination/path" => [ "/array/of", "/source/paths"] } @destination = [:destination] # a directory to write bundles into @sources = [:sources] # array with source dirs @debug = [:debug] # regenerate bundles on each request create_bundles unless @debug end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 |
# File 'lib/rack/cat.rb', line 16 def call(env) create_bundles(Rack::Request.new(env).path) if @debug @app.call(env) end |