Class: Rack::Reloader

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

Defined Under Namespace

Classes: Config

Instance Method Summary collapse

Constructor Details

#initialize(app) {|@config| ... } ⇒ Reloader

Returns a new instance of Reloader.

Yields:

  • (@config)


12
13
14
15
16
17
# File 'lib/rack/reloader.rb', line 12

def initialize(app)
  @app    = app
  @config = Config.new
  @mark   = rand(Time.now.to_i)
  yield(@config) if block_given?
end

Instance Method Details

#call(env) ⇒ Object



19
20
21
22
# File 'lib/rack/reloader.rb', line 19

def call(env)
  status, headers, body = @app.call(env)
  [status, headers, inject_script(body)]
end