Class: Rack::Server

Inherits:
Object show all
Defined in:
lib/tanuki/extensions/rack/server.rb

Instance Method Summary collapse

Instance Method Details

#options_with_tanuki(*args, &block) ⇒ Object

Wraps around Rack::Server#options to update application configuration accordingly.



5
6
7
8
9
10
11
12
13
# File 'lib/tanuki/extensions/rack/server.rb', line 5

def options_with_tanuki(*args, &block)
  rack_server = self
  rackup_options = options_without_tanuki(*args, &block)
  Tanuki::Application.instance_eval do
    rackup_options.each_pair {|k, v| @context.send :"#{k.downcase}=", v }
    @context.running_server = rack_server.server
  end
  rackup_options
end