aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/rack/metal.rb
Commit message (Collapse)AuthorAgeFilesLines
* fix problems with requires in metal choking under development reloading ↵Tim Connor2009-05-041-1/+2
| | | | | | [#2579 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* No more free lunchJeremy Kemper2009-04-221-0/+1
|
* Make sure Metal use ActionController class name conventions [#2242 ↵Luca Guidi2009-03-151-1/+1
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Ensure that loading metals from the main app and engines works on older Ruby ↵Simon Jefford2009-03-051-3/+5
| | | | | | versions [#2143 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Enhanced Rails Metal - the load order of metals can now be configured [#2057 ↵Simon Jefford2009-03-031-3/+13
| | | | | | state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Metal can now line in plugins under app/metal [#2045 state:committed]Matthew Rudy Jacobs2009-02-271-6/+9
| | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Diverge Metal implementation from Rack::Cascade since we want the last app ↵Joshua Peek2008-12-191-13/+22
| | | | to return its headers and body if the status is a 404.
* Cheaper metal cascadeJeremy Kemper2008-12-181-10/+20
|
* Make generated Metal bits a pure rack endpoint application (not middleware)Joshua Peek2008-12-171-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Introduce Rails MetalJoshua Peek2008-12-161-0/+21
# app/metal/poller.rb class Poller < Rails::Rack::Metal def call(env) if env["PATH_INFO"] =~ /^\/poller/ [200, {"Content-Type" => "application/json"}, Message.recent.to_json] else super end end end * There is a generator to help you get started `script/generate metal poller` * Also, metal bits can be ran standalone with rackup `rackup app/metal/poller.rb`