aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/rack/metal.rb
blob: 77d00ab09175b4f5fa1f918928416cc3dde76a25 (plain) (blame)
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