From: Matthias Hecker Date: Wed, 22 Apr 2020 12:40:12 +0000 (+0200) Subject: ensures the path reported by gems does exists X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=452e323bfdb73d6b93ab96f5fc417891e4aa8f53;hp=ec086115a88657621dc923cd209458473bdf5e50;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git ensures the path reported by gems does exists --- diff --git a/lib/rbot/rbotconfig.rb b/lib/rbot/rbotconfig.rb index d6f6bcde..894a1b65 100644 --- a/lib/rbot/rbotconfig.rb +++ b/lib/rbot/rbotconfig.rb @@ -37,8 +37,12 @@ class Bot if gem path = gem.full_gem_path debug "installed via rubygems to #{path}" - @@datadir = "#{path}/data/rbot" - @@coredir = "#{path}/lib/rbot/core" + if File.directory? "#{path}/data/rbot" + @@datadir = "#{path}/data/rbot" + end + if File.directory? "#{path}/lib/rbot/core" + @@coredir = "#{path}/lib/rbot/core" + end else debug "not installed via rubygems" end