diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-06 11:27:38 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-06 11:27:38 +0000 |
commit | e935773b3e115d2d33e6d32f488578c650428ed2 (patch) | |
tree | a0041515250b3ae35864d01d0469246c001e88e5 /lib/rbot | |
parent | 15dc6104fe577661a103ad2e66996f7ced61d155 (diff) |
Create an utils subdir in core, which will store all utility files that can be reloaded without quitting the bot, and move httputil and utils to it
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/core/utils/httputil.rb (renamed from lib/rbot/httputil.rb) | 2 | ||||
-rw-r--r-- | lib/rbot/core/utils/utils.rb (renamed from lib/rbot/utils.rb) | 4 | ||||
-rw-r--r-- | lib/rbot/ircbot.rb | 12 |
3 files changed, 10 insertions, 8 deletions
diff --git a/lib/rbot/httputil.rb b/lib/rbot/core/utils/httputil.rb index d89fa2e9..42b7fdb8 100644 --- a/lib/rbot/httputil.rb +++ b/lib/rbot/core/utils/httputil.rb @@ -1,4 +1,4 @@ -module Irc +module ::Irc module Utils require 'resolv' diff --git a/lib/rbot/utils.rb b/lib/rbot/core/utils/utils.rb index 557ca738..fc89e1c3 100644 --- a/lib/rbot/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -6,7 +6,7 @@ begin $we_have_html_entities_decoder = require 'htmlentities' rescue LoadError $we_have_html_entities_decoder = false - module Irc + module ::Irc module Utils UNESCAPE_TABLE = { 'laquo' => '<<', @@ -281,7 +281,7 @@ rescue LoadError end -module Irc +module ::Irc # miscellaneous useful functions module Utils diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index c744ca51..54513ab4 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -69,7 +69,7 @@ $interrupted = 0 # these first require 'rbot/rbotconfig' require 'rbot/config' -require 'rbot/utils' +# require 'rbot/utils' require 'rbot/irc' require 'rbot/rfc2812' @@ -82,7 +82,7 @@ require 'rbot/message' require 'rbot/language' require 'rbot/dbhash' require 'rbot/registry' -require 'rbot/httputil' +# require 'rbot/httputil' module Irc @@ -279,7 +279,6 @@ class IrcBot Dir.mkdir("#{botclass}/logs") unless File.exist?("#{botclass}/logs") Dir.mkdir("#{botclass}/registry") unless File.exist?("#{botclass}/registry") Dir.mkdir("#{botclass}/safe_save") unless File.exist?("#{botclass}/safe_save") - Utils.set_safe_save_dir("#{botclass}/safe_save") # Time at which the last PING was sent @last_ping = nil @@ -364,8 +363,6 @@ class IrcBot @logs = Hash.new - @httputil = Utils::HttpUtil.new(self) - @plugins = nil @lang = Language::Language.new(self, @config['core.language']) @@ -385,11 +382,16 @@ class IrcBot Dir.mkdir("#{botclass}/plugins") unless File.exist?("#{botclass}/plugins") @plugins = Plugins::pluginmanager @plugins.bot_associate(self) + @plugins.add_botmodule_dir(Config::coredir + "/utils") @plugins.add_botmodule_dir(Config::coredir) @plugins.add_botmodule_dir("#{botclass}/plugins") @plugins.add_botmodule_dir(Config::datadir + "/plugins") @plugins.scan + Utils.set_safe_save_dir("#{botclass}/safe_save") + @httputil = Utils::HttpUtil.new(self) + + @socket = IrcSocket.new(@config['server.name'], @config['server.port'], @config['server.bindhost'], @config['server.sendq_delay'], @config['server.sendq_burst'], :ssl => @config['server.ssl']) @client = IrcClient.new myself.nick = @config['irc.nick'] |