diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-23 19:10:42 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-23 19:10:42 +0200 |
commit | 4494a752c3c568c65fa899c54486153a1a5fa187 (patch) | |
tree | 60149451a075242bd36c5298ea9838d1d2d50f2f /railties/lib/generators/rails/metal/templates | |
parent | 75fbd7393606b9b026418229eb3eb38542753d43 (diff) | |
download | rails-4494a752c3c568c65fa899c54486153a1a5fa187.tar.gz rails-4494a752c3c568c65fa899c54486153a1a5fa187.tar.bz2 rails-4494a752c3c568c65fa899c54486153a1a5fa187.zip |
Change current sstructure.
Diffstat (limited to 'railties/lib/generators/rails/metal/templates')
-rw-r--r-- | railties/lib/generators/rails/metal/templates/metal.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/metal/templates/metal.rb b/railties/lib/generators/rails/metal/templates/metal.rb new file mode 100644 index 0000000000..e94982b69a --- /dev/null +++ b/railties/lib/generators/rails/metal/templates/metal.rb @@ -0,0 +1,12 @@ +# Allow the metal piece to run in isolation +require(File.dirname(__FILE__) + "/../../config/environment") 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"}, ["Not Found"]] + end + end +end |