<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hello,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>So, I grabbed the mongrel_upload_progress code from subversion because I really need something similar for a project I am working on. Anyway, I installed the gem and can't figure out a few things.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1) I'm not sure what Upload &lt; GemPlugin::Plugin "/handlers" is for</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>2) How to call the Progress &lt; GemPlugin::Plugin "/handlers" handler.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>While I was trying to figure it out, I wrote my own test plugin to mess around with the general plugin system and what I think it is is that the handlers aren't registering with a particular uri. In the Rdoc for mongrel there is the following code:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">require 'mongrel'</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11.7px/normal Courier; background-color: rgb(239, 239, 239); min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"> </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">class SimpleHandler &lt; Mongrel::HttpHandler</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">def process(request, response)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">response.start(200) do |head,out|</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">head["Content-Type"] = "text/plain"</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">        </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">out.write("hello!\n")</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">      </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">end</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">    </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">end</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"> </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">end</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11.7px/normal Courier; background-color: rgb(239, 239, 239); min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"> </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">h = Mongrel::HttpServer.new("0.0.0.0", "3000")</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"> </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">h.register("/test", SimpleHandler.new)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"> </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">h.register("/files", Mongrel::DirHandler.new("."))</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"> </SPAN></FONT><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;">h.run.join</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"></SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Now, the key thing here is the h.register which associates a uri with a handler (or the method uri). I don't see anything like that happening with the gem plugins. Am I missing something? What would be the "GemPlugin" way to register a uri with a handler. I'm not even sure that it should be associated with the plugin, in which case do I have to modify mongrel_rails ?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks for any pointers or suggestions on where to look.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-carl</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(239, 239, 239); "><FONT class="Apple-style-span" face="Courier" size="3"><SPAN class="Apple-style-span" style="font-size: 11.7px;"></SPAN></FONT></DIV></BODY></HTML>