diff options
author | Matthias Hecker <mail@apoc.cc> | 2020-04-22 14:40:12 +0200 |
---|---|---|
committer | Matthias Hecker <mail@apoc.cc> | 2020-04-22 14:40:12 +0200 |
commit | 452e323bfdb73d6b93ab96f5fc417891e4aa8f53 (patch) | |
tree | 14a9c4175f55f89eeabbe3d1dea9d0a2e33adca1 | |
parent | ec086115a88657621dc923cd209458473bdf5e50 (diff) |
ensures the path reported by gems does exists
-rw-r--r-- | lib/rbot/rbotconfig.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |