~michaelforrest/use-case-mapper/trunk

« back to all changes in this revision

Viewing changes to vendor/rails/railties/lib/rails_generator/generators/components/metal/templates/metal.rb

  • Committer: Richard Lee (Canonical)
  • Date: 2010-10-15 15:17:58 UTC
  • mfrom: (190.1.3 use-case-mapper)
  • Revision ID: richard.lee@canonical.com-20101015151758-wcvmfxrexsongf9d
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Allow the metal piece to run in isolation
2
 
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
3
 
 
4
 
class <%= class_name %>
5
 
  def self.call(env)
6
 
    if env["PATH_INFO"] =~ /^\/<%= file_name %>/
7
 
      [200, {"Content-Type" => "text/html"}, ["Hello, World!"]]
8
 
    else
9
 
      [404, {"Content-Type" => "text/html"}, ["Not Found"]]
10
 
    end
11
 
  end
12
 
end