Class: Rack::Cat

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/cat.rb

Instance Method Summary collapse

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, options = {})
  @app         = app
  @bundles     = options[:bundles]     # { "/destination/path" => [ "/array/of", "/source/paths"] }
  @destination = options[:destination] # a directory to write bundles into
  @sources     = options[:sources]     # array with source dirs
  @debug       = options[:debug]       # regenerate bundles on each request
  
  create_bundles
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
# File 'lib/rack/cat.rb', line 16

def call(env)
  create_bundles if @debug
  @app.call(env)
end