mailcatcher/lib/mail_catcher/web.rb

22 lines
455 B
Ruby
Raw Normal View History

2014-03-17 01:53:13 -04:00
require "active_support/core_ext/module/delegation"
require "rack/builder"
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
2014-03-17 01:53:13 -04:00
map("/") { run Application }
end
end
2012-10-24 18:45:26 -04:00
2014-03-17 01:53:13 -04:00
delegate :call, :to => :app
end
2011-06-09 23:21:39 -04:00
end