aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-05-29 20:07:47 +0200
committerMikel Lindsaar <raasdnil@gmail.com>2010-06-03 23:32:10 +1000
commited34652d1aca148fea61c5309c1bd5ff3a55abfa (patch)
treeee2fbf07bfca011623c928c0b24a7783925e8f88 /railties/lib/rails/generators
parente6b0ea3f8a252b6795156ad8c0816198f7c18cf9 (diff)
downloadrails-ed34652d1aca148fea61c5309c1bd5ff3a55abfa.tar.gz
rails-ed34652d1aca148fea61c5309c1bd5ff3a55abfa.tar.bz2
rails-ed34652d1aca148fea61c5309c1bd5ff3a55abfa.zip
Removing Metal from Rails 3.
If you have existing Metals, you have a few options: * if your metal behaves like a middleware, add it to the middleware stack via config.middleware.use. You can use methods on the middleware stack to control exactly where it should go * if it behaves like a Rack endpoint, you can link to it in the router. This will result in more optimal routing time, and allows you to remove code in your endpoint that matches specific URLs in favor of the more powerful handling in the router itself. For the future, you can use ActionController::Metal to get a very fast controller with the ability to opt-in to specific controller features without paying the penalty of the full controller stack. Since Rails 3 is closer to Rack, the Metal abstraction is no longer needed.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r--railties/lib/rails/generators/base.rb2
-rw-r--r--railties/lib/rails/generators/rails/metal/USAGE8
-rw-r--r--railties/lib/rails/generators/rails/metal/metal_generator.rb11
-rw-r--r--railties/lib/rails/generators/rails/metal/templates/metal.rb12
4 files changed, 1 insertions, 32 deletions
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index 766644bbc2..bd2260fc29 100644
--- a/railties/lib/rails/generators/base.rb
+++ b/railties/lib/rails/generators/base.rb
@@ -288,7 +288,7 @@ module Rails
end
# Removes the namespaces and get the generator name. For example,
- # Rails::Generators::MetalGenerator will return "metal" as generator name.
+ # Rails::Generators::ModelGenerator will return "model" as generator name.
#
def self.generator_name
@generator_name ||= begin
diff --git a/railties/lib/rails/generators/rails/metal/USAGE b/railties/lib/rails/generators/rails/metal/USAGE
deleted file mode 100644
index c88325a444..0000000000
--- a/railties/lib/rails/generators/rails/metal/USAGE
+++ /dev/null
@@ -1,8 +0,0 @@
-Description:
- Cast some metal!
-
-Examples:
- `rails generate metal poller`
-
- This will create:
- Metal: app/metal/poller.rb
diff --git a/railties/lib/rails/generators/rails/metal/metal_generator.rb b/railties/lib/rails/generators/rails/metal/metal_generator.rb
deleted file mode 100644
index fe4f945cad..0000000000
--- a/railties/lib/rails/generators/rails/metal/metal_generator.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Rails
- module Generators
- class MetalGenerator < NamedBase
- check_class_collision
-
- def create_metal_file
- template "metal.rb", "app/metal/#{file_name}.rb"
- end
- end
- end
-end
diff --git a/railties/lib/rails/generators/rails/metal/templates/metal.rb b/railties/lib/rails/generators/rails/metal/templates/metal.rb
deleted file mode 100644
index 8cc3f1f258..0000000000
--- a/railties/lib/rails/generators/rails/metal/templates/metal.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# Allow the metal piece to run in isolation
-require File.expand_path('../../../config/environment', __FILE__) unless defined?(Rails)
-
-class <%= class_name %>
- def self.call(env)
- if env["PATH_INFO"] =~ /^\/<%= file_name %>/
- [200, {"Content-Type" => "text/html"}, ["Hello, World!"]]
- else
- [404, {"Content-Type" => "text/html", "X-Cascade" => "pass"}, ["Not Found"]]
- end
- end
-end