From 8dd10a34da81fd11c562dd4db6a23a6f4abc533c Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Mon, 30 Jun 2008 11:37:37 +0200 Subject: Add a cal.path option with the path to the cal program. --- data/rbot/plugins/cal.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/rbot/plugins/cal.rb b/data/rbot/plugins/cal.rb index dd1d1538..bfac39e5 100644 --- a/data/rbot/plugins/cal.rb +++ b/data/rbot/plugins/cal.rb @@ -1,12 +1,21 @@ class CalPlugin < Plugin + Config.register Config::StringValue.new('cal.path', + :default => '/usr/bin/cal', + :desc => _('Path to the cal program')) + def help(plugin, topic="") "cal [month year] => show current calendar [optionally specify month and year]" end + + def cal_path + @bot.config["cal.path"] + end + def cal(m, params) if params.has_key?(:month) - m.reply Utils.safe_exec("cal", params[:month], params[:year]) + m.reply Utils.safe_exec(cal_path, params[:month], params[:year]) else - m.reply Utils.safe_exec("cal") + m.reply Utils.safe_exec(cal_path) end end end -- cgit v1.2.3