diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/rack/metal.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/railties/lib/rails/rack/metal.rb b/railties/lib/rails/rack/metal.rb index 8dfbedad90..77d00ab091 100644 --- a/railties/lib/rails/rack/metal.rb +++ b/railties/lib/rails/rack/metal.rb @@ -1,21 +1,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"] } - - def self.call(env) - new(NotFound).call(env) - end - - def initialize(app) - @app = app - end - - def call(env) - @app.call(env) - end end end end |