github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

rails / rails

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4,959
    • 829
  • Source
  • Commits
  • Network (829)
  • Downloads (61)
  • Wiki (4)
  • Graphs
  • Tree: f98d8ee

click here to add a description

click here to add a homepage

  • Branches (6)
    • 1-2-stable
    • 2-0-stable
    • 2-1-stable
    • 2-2-stable
    • 2-3-stable
    • master
  • Tags (61)
    • v3.0.0.beta1
    • v2.3.5
    • v2.3.4
    • v2.3.3.1
    • v2.3.3
    • v2.3.2.1
    • v2.3.2
    • v2.3.1
    • v2.3.0
    • v2.2.3
    • v2.2.2
    • v2.2.1
    • v2.2.0
    • v2.1.2
    • v2.1.1
    • v2.1.0_RC1
    • v2.1.0
    • v2.0.5
    • v2.0.4
    • v2.0.3
    • v2.0.2
    • v2.0.1
    • v2.0.0_RC2
    • v2.0.0_RC1
    • v2.0.0_PR
    • v2.0.0
    • v1.2.6
    • v1.2.5
    • v1.2.4
    • v1.2.3
    • v1.2.2
    • v1.2.1
    • v1.2.0_RC2
    • v1.2.0_RC1
    • v1.2.0
    • v1.1.6
    • v1.1.5
    • v1.1.4
    • v1.1.3
    • v1.1.2
    • v1.1.1
    • v1.1.0_RC1
    • v1.1.0
    • v1.0.0
    • v0.14.4
    • v0.14.3
    • v0.14.2
    • v0.14.1
    • v0.13.1
    • v0.13.0
    • v0.12.0
    • v0.11.1
    • v0.11.0
    • v0.10.1
    • v0.10.0
    • v0.9.5
    • v0.9.4.1
    • v0.9.4
    • v0.9.3
    • v0.9.2
    • v0.9.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Ruby on Rails — Read more

  cancel

http://rubyonrails.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Fix up failing tests broke by 2316e7d 
josh (author)
Fri Feb 06 22:35:15 -0800 2009
commit  f98d8ee72b2fd92bf0e09f3cade60add9efd3a15
tree    9d2e9b09d08d5a003a044c15975be38e7febba0f
parent  2316e7dfb16518d4d0d92165bcd53b262080fc37
rails / railties / lib / rails / rack / metal.rb railties/lib/rails/rack/metal.rb
100644 37 lines (31 sloc) 0.847 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'active_support/ordered_hash'
 
module Rails
  module Rack
    class Metal
      NotFoundResponse = [404, {}, []].freeze
      NotFound = lambda { NotFoundResponse }
 
      def self.metals
        base = "#{Rails.root}/app/metal"
        matcher = /\A#{Regexp.escape(base)}\/(.*)\.rb\Z/
 
        Dir["#{base}/**/*.rb"].sort.map do |file|
          file.sub!(matcher, '\1')
          require file
          file.classify.constantize
        end
      end
 
      def initialize(app)
        @app = app
        @metals = ActiveSupport::OrderedHash.new
        self.class.metals.each { |app| @metals[app] = true }
        freeze
      end
 
      def call(env)
        @metals.keys.each do |app|
          result = app.call(env)
          return result unless result[0].to_i == 404
        end
        @app.call(env)
      end
    end
  end
end
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server