From 703163e4bbff82051f9adf46177fb2f2ce6d6ba6 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 2 Sep 2007 07:16:28 +0000 Subject: Refactor version string construction --- lib/rbot/core/config.rb | 10 +++++++++- lib/rbot/ircbot.rb | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rbot/core/config.rb b/lib/rbot/core/config.rb index 21073c23..7ff7a88c 100644 --- a/lib/rbot/core/config.rb +++ b/lib/rbot/core/config.rb @@ -9,6 +9,14 @@ class ConfigModule < CoreBotModule + def version_string + _("I'm a v. %{version} rubybot%{copyright}%{url}") % { + :version => $version, + :copyright => ", #{Irc::Bot::COPYRIGHT_NOTICE}", + :url => " - #{Irc::Bot::SOURCE_URL}" + } + end + def save @bot.config.save end @@ -167,7 +175,7 @@ class ConfigModule < CoreBotModule # end def bot_version(m, param) - m.reply _("I'm a v. %{version} rubybot, (c) Tom Gilbert and the rbot development team - http://linuxbrit.co.uk/rbot/") % {:version => $version} + m.reply version_string end def handle_help(m, params) diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index f1f39f30..d488e173 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -120,6 +120,7 @@ module Irc # handles them or passes them to plugins, and contains core functionality. class Bot COPYRIGHT_NOTICE = "(c) Tom Gilbert and the rbot development team" + SOURCE_URL = "http://linuxbrit.co.uk" # the bot's Auth data attr_reader :auth -- cgit v1.2.3