[Mongrel] need help writing a plugin

Jeroen Houben jeroen at supercool.nl
Mon Mar 12 08:47:27 EDT 2007


I'm halfway developing a tiny plugin that allows people to scrub flash 
video files. I've got my plugin setup to monitor a directory /movies.
Whenever a .flv file is requested within that directory, some stuff 
should happen, if not, the request should be processed as usual. I don't 
know how to do the latter..

require 'mongrel'
require 'gem_plugin'

class Streamert < GemPlugin::Plugin "/handlers"
  include Mongrel::HttpHandlerPlugin

  def initialize(options = {})
    @docroot = options[:cwd] + "/" + options[:docroot]

  def process(request, response)
    # only stream flv files
    unless File.extname(request.params['REQUEST_PATH']).downcase == '.flv'
        # somehow call the original process method?    

How would I accomplish this?


More information about the Mongrel-users mailing list