Module: MailCatcher::Web

Extended by:
Web
Included in:
Web
Defined in:
lib/mail_catcher/web.rb,
lib/mail_catcher/web/application.rb

Defined Under Namespace

Classes: Application

Instance Method Summary collapse

Instance Method Details

#appObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/mail_catcher/web.rb', line 9

def app
  @@app ||= Rack::Builder.new do
    map(MailCatcher.options[:http_path]) do
      run Application
    end

    # This should only affect when http_path is anything but "/" above
    run lambda { |env| [302, {"location" => MailCatcher.options[:http_path]}, []] }
  end
end

#call(env) ⇒ Object



20
21
22
# File 'lib/mail_catcher/web.rb', line 20

def call(env)
  app.call(env)
end