Make plasma libs build.
[amarok.git] / supplementary_scripts / rbot / svn_revision.rb
blobcfbc169b4019a46921956029654ecc17ce87a5cf
1 # Copyright (c) 2006 Harald Sitter
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies of the Software and its documentation and acknowledgment shall be
12 # given in the documentation and software packages that this Software was
13 # used.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 # THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 class KDESVNPlugin < Plugin
23     def help(plugin,topic="")
24         "svn <path>/<revision#> - outputs websvn.kde.org URL of given path or revision"
25     end
27     def privmsg(m)
28         unless m.params
29             m.reply("incorrect usage: "+help(m.plugin))
30             return
31         end
32         revision = m.params.scan(/^#?([0-9]+)/)
33         if revision.length == 0
34             revision = m.params.scan(/^#?[bt].{4,}/)
35                 if revision.length == 0
36                     m.reply("Input not processible")
37                     return
38                 else
39                     m.reply("http://websvn.kde.org/#{revision}")
40                     return
41                 end
42         end
43         str = "http://websvn.kde.org/?rev=#{revision}&view=rev"
44         m.reply(str)
45     end
46 end
48 plugin = KDESVNPlugin.new
49 plugin.register("revision")
50 plugin.register("svn")