Skip to content

Instantly share code, notes, and snippets.

@Voker57
Created March 10, 2010 22:21
Show Gist options
  • Save Voker57/328517 to your computer and use it in GitHub Desktop.
Save Voker57/328517 to your computer and use it in GitHub Desktop.
class FireUrlPlugin < Plugin
def fireurl(m, params)
u = URI.parse(params[:what])
if u.path
path = u.path
path.gsub! %r|([^/]+)| do |s|
URI.escape(s, /./)
end
u.path = path
end
m.reply u.to_s
end
end
plugin = FireUrlPlugin.new
plugin.map "fireurl :what", :action => "fireurl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment