2014-03-17 01:53:13 -04:00
|
|
|
require "active_support/core_ext/module/delegation"
|
|
|
|
require "rack/builder"
|
2010-10-27 15:12:26 -04:00
|
|
|
|
2014-03-17 01:53:13 -04:00
|
|
|
require "mail_catcher/web/application"
|
2014-03-17 01:31:05 -04:00
|
|
|
|
2014-03-17 01:53:13 -04:00
|
|
|
module MailCatcher
|
|
|
|
module Web extend self
|
|
|
|
def app
|
|
|
|
@@app ||= Rack::Builder.new do
|
|
|
|
if ENV["MAILCATCHER_ENV"] == "development"
|
|
|
|
require "mail_catcher/web/assets"
|
|
|
|
map("/assets") { run Assets }
|
|
|
|
end
|
2010-10-27 15:12:26 -04:00
|
|
|
|
2014-03-17 01:53:13 -04:00
|
|
|
map("/") { run Application }
|
|
|
|
end
|
2010-10-27 15:12:26 -04:00
|
|
|
end
|
2012-10-24 18:45:26 -04:00
|
|
|
|
2014-03-17 01:53:13 -04:00
|
|
|
delegate :call, :to => :app
|
2010-10-27 15:12:26 -04:00
|
|
|
end
|
2011-06-09 23:21:39 -04:00
|
|
|
end
|