diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-26 15:27:40 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-26 15:27:46 +0100 |
commit | edb8131535c74ac215bf36c0d58d2019ed091a74 (patch) | |
tree | bac5defe29f0ac5aff95a3692e36eadab01a1d55 /railties/lib/rails/rack | |
parent | 517b35a2bbe5ec381fecbbc54e67ba053f9da420 (diff) | |
download | rails-edb8131535c74ac215bf36c0d58d2019ed091a74.tar.gz rails-edb8131535c74ac215bf36c0d58d2019ed091a74.tar.bz2 rails-edb8131535c74ac215bf36c0d58d2019ed091a74.zip |
Move Rails::Rack::Metal to Rails::Application::Metal and just add cascade if any metal was declared.
Diffstat (limited to 'railties/lib/rails/rack')
-rw-r--r-- | railties/lib/rails/rack/metal.rb | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/railties/lib/rails/rack/metal.rb b/railties/lib/rails/rack/metal.rb deleted file mode 100644 index 732936da32..0000000000 --- a/railties/lib/rails/rack/metal.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'action_dispatch' - -module Rails - module Rack - class Metal - def self.paths - @paths ||= [] - end - - def initialize(list=nil) - metals = [] - list = Array(list || :all).map(&:to_sym) - - self.class.paths.each do |path| - matcher = /\A#{Regexp.escape(path)}\/(.*)\.rb\Z/ - Dir.glob("#{path}/**/*.rb").sort.each do |metal_path| - metal = metal_path.sub(matcher, '\1').to_sym - next unless list.include?(metal) || list.include?(:all) - require_dependency metal - metals << metal - end - end - - metals = metals.sort_by do |m| - [list.index(m) || list.index(:all), m.to_s] - end - - @metals = metals.map { |m| m.to_s.camelize.constantize } - end - - def new(app) - ActionDispatch::Cascade.new(@metals, app) - end - - def name - ActionDispatch::Cascade.name - end - alias_method :to_s, :name - end - end -end |