1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails_generator
Joshua Peek 61a41154f7 Make generated Metal bits a pure rack endpoint application (not middleware)
Instead of calling super to pass the request on, return a 404.
The modified app looks like this:

  # app/metal/poller.rb
  class Poller
    def self.call(env)
      if env["PATH_INFO"] =~ /^\/poller/
        [200, {"Content-Type" => "text/html"}, "Hello, World!"]
      else
        [404, {"Content-Type" => "text/html"}, "Not Found"]
      end
    end
  end

But you aren't locked in to just Rails:

  # app/metal/api.rb
  require 'sinatra'
  Sinatra::Application.default_options.merge!(:run => false, :env => :production)
  Api = Sinatra.application unless defined? Api

  get '/interesting/new/ideas' do
    'Hello Sinatra!'
  end
2008-12-17 09:53:56 -06:00
..
generators Make generated Metal bits a pure rack endpoint application (not middleware) 2008-12-17 09:53:56 -06:00
scripts Merge with docrails. 2008-07-16 13:01:23 +01:00
base.rb Add "-m/--template" option to Rails generator to apply template to generated application. 2008-12-02 19:39:11 +01:00
commands.rb Add "-m/--template" option to Rails generator to apply template to generated application. 2008-12-02 19:39:11 +01:00
generated_attribute.rb Generate belongs_to association when generating a model 2008-08-23 21:54:43 +03:00
lookup.rb Fix script/generate warning 2008-10-21 01:47:44 +01:00
manifest.rb Added new generator framework that informs about its doings on generation and enables updating and destruction of generated artifacts. See the new script/destroy and script/update for more details #487 [bitsweat] 2005-02-07 13:14:05 +00:00
options.rb Git support for script/generate. Closes #10690. 2008-02-02 02:55:14 +00:00
scripts.rb Merge with docrails. 2008-07-16 13:01:23 +01:00
secret_key_generator.rb Explicitly require AS::Deprecation for the SecretKeyGenerator. Bring in ActiveSupport::TestCase for its tests. 2008-11-24 22:39:11 -08:00
simple_logger.rb Added new generator framework that informs about its doings on generation and enables updating and destruction of generated artifacts. See the new script/destroy and script/update for more details #487 [bitsweat] 2005-02-07 13:14:05 +00:00
spec.rb Generators: look for generators in all gems, not just those suffixed with _generator, in the gem's generators or rails_generators directory. Allow use of the rails_generators directory instead of the standard generators directory in plugins also. Closes #8730. 2007-06-27 09:25:25 +00:00