[51077] trunk/base/portmgr/bots/trac.rb
Ryan Schmidt
ryandesign at macports.org
Sun May 17 08:09:34 PDT 2009
On May 17, 2009, at 09:52, and.damore at macports.org wrote:
> 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.
Thanks for your continued improvements!
It looks like you also made whitespace changes to this file in this
commit. While it's true that we'd prefer source files to contain
spaces and not tabs, and it's fine to make such changes, I'd like to
ask for whitespace changes to be committed separately from functional
changes in the future. This way, when I'm looking through the log and
see a commit with the message "whitespace changes only" I can ignore
it, and when I see a commit with the message "'paste' superpower for
mpbot" I can look at the diff and see exactly what changes were
necessary to implement that feature. As it is, looking at the below
diff, I have to spend a lot of time trying to figure out where your
real changes are.
> 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
More information about the macports-dev
mailing list