diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-08-03 20:07:14 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-08-03 20:07:14 +0000 |
commit | dd0b318cfd3df017b1ec4e44afc2f4e412fd2033 (patch) | |
tree | e364fc26af86c1105124385d8da2768262e97d23 /lib/rbot/config.rb | |
parent | fba4b7bba7a5d15f2b98f4d9f1ece390881c5ae9 (diff) |
Wed Aug 03 15:25:07 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* Added french language file (TODO most of the plugins just talk english)
* The way the Enum configs were set up, it wasn't possible to add language
files to rbot at runtime (the directory was only scanned at startup). Now
you can set a values Proc, which is called to return a list of allowed
values whenever it's queried.
* Added Config module for determining where we were installed.
Unfortunately rubygems is a total whore in this regard, and I hope the
current hackery I have to do to support it becomes redundant in the
future.
Diffstat (limited to 'lib/rbot/config.rb')
-rw-r--r-- | lib/rbot/config.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rbot/config.rb b/lib/rbot/config.rb index 834b5a98..e4237e81 100644 --- a/lib/rbot/config.rb +++ b/lib/rbot/config.rb @@ -120,6 +120,13 @@ module Irc super @values = params[:values] end + def values + if @values.instance_of?(Proc) + return @values.call(BotConfig.bot) + else + return @values + end + end def parse(string) unless @values.include?(string) raise ArgumentError, "invalid value #{string}, allowed values are: " + @values.join(", ") |