Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [8c3a54366435eebc2c8aa63b63e1349ce74a7b38] by Joshua Peek

Revision 8c3a54366435eebc2c8aa63b63e1349ce74a7b38, committed by Joshua Peek · December 16th, 2008 @ 07:15 PM

Introduce Rails Metal

# 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 http://github.com/rails/rails/co...

6 changed files

  • M railties/lib/initializer.rb
  • M railties/lib/rails/rack.rb
  • M railties/lib/rails/rack/metal.rb
  • M railties/lib/rails_generator/generators/components/metal/USAGE
  • M railties/lib/rails_generator/generators/components/metal/metal_generator.rb
  • M railties/lib/rails_generator/generators/components/metal/templates/metal.rb