[51077] trunk/base/portmgr/bots/trac.rb

and.damore at macports.org and.damore at macports.org
Sun May 17 07:52:51 PDT 2009


Revision: 51077
          http://trac.macports.org/changeset/51077
Author:   and.damore at macports.org
Date:     2009-05-17 07:52:50 -0700 (Sun, 17 May 2009)
Log Message:
-----------
"paste" superpower for mpbot.

Modified Paths:
--------------
    trunk/base/portmgr/bots/trac.rb

Modified: trunk/base/portmgr/bots/trac.rb
===================================================================
--- trunk/base/portmgr/bots/trac.rb	2009-05-17 14:21:55 UTC (rev 51076)
+++ trunk/base/portmgr/bots/trac.rb	2009-05-17 14:52:50 UTC (rev 51077)
@@ -1,61 +1,66 @@
 #
-#	trac.rb
+#   trac.rb
 #
-#	Plugin to rbot (http://ruby-rbot.org/), an irc bot, to provide
-#	services related to MacPorts trac systemfor the #macports channel
-#	on freenode.net, created from PortPlugin by James D. Berry
+#   Plugin to rbot (http://ruby-rbot.org/), an irc bot, to provide
+#   services related to MacPorts trac systemfor the #macports channel
+#   on freenode.net, created from PortPlugin by James D. Berry
 #
-#	By Andrea D'Amore
+#   By Andrea D'Amore
 #
-#	$Id: $
+#   $Id: $
 
 require 'stringio'
 
 class TracPlugin < Plugin
 
-	def help(plugin, topic="")
-		case topic
-		  when "ticket"
-			return "ticket <ticket no.> => show http link for ticket # <ticket no.>"
-		  when "faq"
-			return "faq => show FAQs' URL"
-		  when "guide"
-			return "guide [chunked] => show The Guide's URL. Don't Panic."		 
-		  else
-			return "trac module provides: !ticket, !faq, !guide"
-		end
-	end
+    def help(plugin, topic="")
+        case topic
+          when "ticket"
+            return "ticket <ticket no.> => show http link for ticket # <ticket no.>"
+          when "faq"
+            return "faq => show FAQs' URL"
+          when "guide"
+            return "guide [chunked] => show The Guide's URL. Don't Panic."       
+          else
+            return "trac module provides: !ticket, !faq, !guide"
+        end
+    end
 
-	def ticket(m, params)
-		number = params[:number][/^#?(\d*)$/,1]
-		if ( number )
-			url = "http://trac.macports.org/ticket/"+number
-			m.reply "#{url}"
-		else
-			m.reply "Use either #1234 or 1234 for ticket number"
-		end
-	end
+    def ticket(m, params)
+        number = params[:number][/^#?(\d*)$/,1]
+        if ( number )
+            url = "http://trac.macports.org/ticket/"+number
+            m.reply "#{url}"
+        else
+            m.reply "Use either #1234 or 1234 for ticket number"
+        end
+    end
 
-	def faq(m, params)
-		m.reply "FAQs are at: http://trac.macports.org/wiki/FAQ"
-	end
+    def faq(m, params)
+        m.reply "FAQs are at: http://trac.macports.org/wiki/FAQ"
+    end
 
-	def guide(m, params)
-		if ( params[:parm] == "chunked" )
-			m.reply "http://guide.macports.org/chunked/index.html"
-		else
-			m.reply "http://guide.macports.org/"
-		end
-	end
-	
-	def team(m, params)
-		m.reply "http://trac.macports.org/wiki/MacPortsDevelopers"
-	end
+    def paste(m, params)
+        m.reply "Paste texts more than 3 rows using: http://paste.lisp.org/new/macports"
+    end
 
+    def guide(m, params)
+        if ( params[:parm] == "chunked" )
+            m.reply "http://guide.macports.org/chunked/index.html"
+        else
+            m.reply "http://guide.macports.org/"
+        end
+    end
+    
+    def team(m, params)
+        m.reply "http://trac.macports.org/wiki/MacPortsDevelopers"
+    end
+
 end
 
 plugin = TracPlugin.new
-plugin.map 'ticket :number', :action => 'ticket'
-plugin.map 'faq :parm', :action => 'faq', :defaults => {:parm => ""}
-plugin.map 'guide :parm', :action => 'guide', :defaults => {:parm => ""}
-plugin.map 'team', :action => 'team'
\ No newline at end of file
+plugin.map 'ticket :number',    :action => 'ticket'
+plugin.map 'faq :parm',         :action => 'faq'
+plugin.map 'paste :parm',       :action => 'paste'
+plugin.map 'guide :parm',       :action => 'guide',     :defaults => {:parm => ""}
+plugin.map 'team',              :action => 'team'
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090517/96564335/attachment.html>


More information about the macports-changes mailing list