]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
* Fixed the new http.proxy* settings, they work!
authorTom Gilbert <tom@linuxbrit.co.uk>
Tue, 2 Aug 2005 15:28:36 +0000 (15:28 +0000)
committerTom Gilbert <tom@linuxbrit.co.uk>
Tue, 2 Aug 2005 15:28:36 +0000 (15:28 +0000)
* Fixed a bug with auth-checking for the config module
* misc tweaks

ChangeLog
docgen
lib/rbot/auth.rb
lib/rbot/config.rb
lib/rbot/httputil.rb
lib/rbot/ircbot.rb
lib/rbot/messagemapper.rb
rbot.gemspec

index d470bae421cf4a1e25b370dfe0c02990c3ba58f1..78d551bf93d48906827a76add9cbbfac476ad045 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Aug 02 16:27:36 BST 2005  Tom Gilbert <tom@linuxbrit.co.uk>
+
+  * Fixed the new http.proxy* settings, they work!
+       * Fixed a bug with auth-checking for the config module
+       * misc tweaks
+
 Sun Jul 31 02:20:08 BST 2005  Tom Gilbert <tom@linuxbrit.co.uk>
 
   * Updated docgen to generate rdoc again with the new repo structure
diff --git a/docgen b/docgen
index c7943409ed1070063153af89c1bce9f0aab5d337..a35bfc5d0a04f583b9d07f01b3b6875232ee4a6c 100755 (executable)
--- a/docgen
+++ b/docgen
@@ -1,3 +1,3 @@
 #!/bin/sh
-rdoc -a -i 'lib' --exclude '(data/|setup.rb|post-config.rb|rbotconfig.rb|timertest.rb)' --main lib/rbot/ircbot.rb -o doc lib bin
+rdoc -a -i 'lib' --exclude '(post-config.rb|rbotconfig.rb)' --main lib/rbot/ircbot.rb -o doc lib bin/rbot
 
index ae7199e169607473e46cedc9d6c2e78a2b770beb..cc11a5a2245d7a64e78744680c0ec6fca27d90ef 100644 (file)
@@ -20,7 +20,8 @@ module Irc
   # on hostmask and userlevel.
   class IrcAuth
     BotConfig.register BotConfigStringValue.new('auth.password',
-      :default => "Your password for maxing your auth with the bot (used to associate new hostmasks with your owner-status etc)")
+      :default => "rbotauth", :wizard => true,
+      :desc => "Your password for maxing your auth with the bot (used to associate new hostmasks with your owner-status etc)")
     
     # create a new IrcAuth instance.
     # bot:: associated bot class
index a452292651d74896ce38bec46172c21af984c196..834b5a988dac35b899a52898f0a651a6da767049 100644 (file)
@@ -229,6 +229,7 @@ module Irc
       value = params[:value].to_s
       unless @@items.has_key?(key)
         m.reply "no such config key #{key}"
+        return
       end
       begin
         @@items[key].set_string(value)
@@ -263,7 +264,7 @@ module Irc
       end
     end
     def usage(m,params)
-      m.reply "incorrect usage, try '#{@bot.nick}: help config'"
+      m.reply "incorrect usage, try '#{@@bot.nick}: help config'"
     end
 
     # bot:: parent bot class
index c6f51d8e5a39c9439d99ac289550e747bb8742d1..e234dc101d32450e88c381a68d92bc4e9c15b70b 100644 (file)
@@ -44,7 +44,7 @@ class HttpUtil
 
     list = [uri.host]
     begin
-      list.push Resolv.getaddresses(uri.host)
+      list.concat Resolv.getaddresses(uri.host)
     rescue StandardError => err
       puts "warning: couldn't resolve host uri.host"
     end
@@ -90,10 +90,10 @@ class HttpUtil
 
     if @bot.config["http.use_proxy"]
       if (ENV['http_proxy'])
-        proxy = URI.parse ENV['http_proxy']
+        proxy = URI.parse ENV['http_proxy'] rescue nil
       end
       if (@bot.config["http.proxy_uri"])
-        proxy = URI.parse ENV['http_proxy_uri']
+        proxy = URI.parse @bot.config["http.proxy_uri"] rescue nil
       end
       if proxy
         debug "proxy is set to #{proxy.uri}"
index 6bdf7bdf8eef03f59bf1a1ffa7efa88840183adb..2dcede3ea924749201c65661e95958056c229fde 100644 (file)
@@ -71,6 +71,9 @@ class IrcBot
   # channel info for channels the bot is in
   attr_reader :channels
 
+  # bot's irc socket
+  attr_reader :socket
+
   # bot's object registry, plugins get an interface to this for persistant
   # storage (hash interface tied to a bdb file, plugins use Accessors to store
   # and restore objects in their own namespaces.)
index 445b80f5101b4b17a73bebd42bcf2493573b947b..c8e2b6ba166bd612bc4e10583015f97f0ad51366 100644 (file)
@@ -29,15 +29,17 @@ module Irc
         else
           action = route.options[:action] ? route.options[:action] : route.items[0]
           next unless @parent.respond_to?(action)
-          auth = route.options[:auth] ? route.options[:auth] : action
+          auth = route.options[:auth] ? route.options[:auth] : route.items[0]
+          debug "checking auth for #{auth}"
           if m.bot.auth.allow?(auth, m.source, m.replyto)
             debug "route found and auth'd: #{action.inspect} #{options.inspect}"
             @parent.send(action, m, options)
             return true
           end
+          debug "auth failed for #{auth}"
           # if it's just an auth failure but otherwise the match is good,
           # don't try any more handlers
-          break
+          return false
         end
       end
       debug failures.inspect
index 14e5cec827804a4004f16d1ace9f225951f25ba8..c63f3836446124af12b3368dbfe248774912d70a 100644 (file)
@@ -28,9 +28,8 @@ spec = Gem::Specification.new do |s|
   s.autorequire = 'rbot/ircbot'
   s.has_rdoc = true
   s.rdoc_options = ['--include', 'lib', '--exclude',
-  '(post-config.rb|rbotconfig.rb)'
-  '--title', 'rbot API Documentation', '--main', 'lib/rbot/ircbot.rb', 
-  'lib', 'bin/rbot']
+  '(post-config.rb|rbotconfig.rb)', '--title', 'rbot API Documentation',
+  '--main', 'lib/rbot/ircbot.rb', 'lib', 'bin/rbot']
 
   #### Author and project details.