This project is archived and is in readonly mode.

#2045 ✓committed
MatthewRudy

[Patch] Metals should be loaded from Engines

Reported by MatthewRudy | February 22nd, 2009 @ 08:18 PM | in 2.x

I'd like to bundle a simple "/backlog" request to my RudeQueue plugin (http://github.com/matthewrudy/ru...

and I'd like to do it as a metal


class RudeQueue::Backlog
  def self.call(env)
    if env["PATH_INFO"] =~ /^\/backlog/
      [200, {"Content-Type" => "text/html"}, [RudeQueue.backlog.to_s]]
    else
      [404, {"Content-Type" => "text/html"}, ["Not Found"]]
    end
  end
end

it seems to make sense,

however Engines don't currently load their Metal.

Here's my fork which fixes that http://github.com/matthewrudy/ru...

and a patch is also attached.

Any suggestions on how to better format the code, or manage the paths is very much welcome. (notably it seems to be very hard to test in code... I've tested it manually)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages