1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
module Rails module Rack class Metal def self.new(app) apps = Dir["#{Rails.root}/app/metal/*.rb"].map do |file| File.basename(file, '.rb').camelize.constantize end apps << app ::Rack::Cascade.new(apps) end NotFound = lambda { |env| [404, {"Content-Type" => "text/html"}, "Not Found"] } end end end