aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/rack
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/rack')
-rw-r--r--railties/lib/rails/rack/log_tailer.rb4
-rw-r--r--railties/lib/rails/rack/metal.rb59
2 files changed, 2 insertions, 61 deletions
diff --git a/railties/lib/rails/rack/log_tailer.rb b/railties/lib/rails/rack/log_tailer.rb
index 077311be3c..3fa45156c3 100644
--- a/railties/lib/rails/rack/log_tailer.rb
+++ b/railties/lib/rails/rack/log_tailer.rb
@@ -13,11 +13,11 @@ module Rails
def call(env)
response = @app.call(env)
- tail_log
+ tail!
response
end
- def tail_log
+ def tail!
@file.seek @cursor
mod = @file.mtime.to_f
diff --git a/railties/lib/rails/rack/metal.rb b/railties/lib/rails/rack/metal.rb
deleted file mode 100644
index 6c0732f732..0000000000
--- a/railties/lib/rails/rack/metal.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'active_support/ordered_hash'
-require 'active_support/core_ext/class/attribute_accessors'
-require 'active_support/dependencies'
-
-module Rails
- module Rack
- class Metal
- NotFoundResponse = [404, {}, []].freeze
- NotFound = lambda { NotFoundResponse }
-
- cattr_accessor :metal_paths
- self.metal_paths = ["#{Rails.root}/app/metal"]
- cattr_accessor :requested_metals
-
- cattr_accessor :pass_through_on
- self.pass_through_on = 404
-
- def self.metals
- matcher = /#{Regexp.escape('/app/metal/')}(.*)\.rb\Z/
- metal_glob = metal_paths.map{ |base| "#{base}/**/*.rb" }
- all_metals = {}
-
- metal_glob.each do |glob|
- Dir[glob].sort.map do |file|
- file = file.match(matcher)[1]
- all_metals[file.camelize] = file
- end
- end
-
- load_list = requested_metals || all_metals.keys
-
- load_list.map do |requested_metal|
- if metal = all_metals[requested_metal]
- require_dependency metal
- requested_metal.constantize
- end
- end.compact
- end
-
- def initialize(app)
- @app = app
- @pass_through_on = {}
- [*self.class.pass_through_on].each { |status| @pass_through_on[status] = true }
-
- @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 @pass_through_on.include?(result[0].to_i)
- end
- @app.call(env)
- end
- end
- end
-end