diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-06-30 16:08:47 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-06-30 16:08:47 +0200 |
commit | d40cd1fc0d9dff1e23bb0c902028a61bc8e725ee (patch) | |
tree | bf6cf5d1faa4ed4c94ad6c50f915fb5f23a42384 | |
parent | c7d8c8208498a2072f8e37e02790e8db74ba8ed2 (diff) |
figlet plugin: check paths and fonts using Utils.safe_exec
-rw-r--r-- | data/rbot/plugins/figlet.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/rbot/plugins/figlet.rb b/data/rbot/plugins/figlet.rb index 1b0c9fc0..64be496c 100644 --- a/data/rbot/plugins/figlet.rb +++ b/data/rbot/plugins/figlet.rb @@ -58,10 +58,10 @@ class FigletPlugin < Plugin def test_figlet #check that figlet is present - @has[:figlet] = File.exist?(figlet_path) + @has[:figlet] = !!(Utils.safe_exec("#{figlet_path} -v") ; $?) # check that figlet actually has the font installed - @has[:figlet_font] = !!system("#{figlet_path} -f #{figlet_font} test test test") + @has[:figlet_font] = !!(Utils.safe_exec("#{figlet_path} -f #{figlet_font} test test test") ; $?) # set the commandline params @params[:figlet] = ['-k', '-w', MAX_WIDTH.to_s, '-C', 'utf8'] @@ -72,10 +72,10 @@ class FigletPlugin < Plugin def test_toilet #check that toilet is present - @has[:toilet] = File.exist?(toilet_path) + @has[:toilet] = !!(Utils.safe_exec("#{toilet_path} -v") ; $?) # check that toilet actually has the font installed - @has[:toilet_font] = !!system("#{toilet_path} -f #{toilet_font} test test test") + @has[:toilet_font] = !!(Utils.safe_exec("#{toilet_path} -f #{toilet_font} test test test") ; $?) # set the commandline params @params[:toilet] = ['-k', '-w', MAX_WIDTH.to_s, '-E', 'utf8', '--irc'] |