summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hecker <mail@apoc.cc>2020-04-22 14:40:12 +0200
committerMatthias Hecker <mail@apoc.cc>2020-04-22 14:40:12 +0200
commit452e323bfdb73d6b93ab96f5fc417891e4aa8f53 (patch)
tree14a9c4175f55f89eeabbe3d1dea9d0a2e33adca1
parentec086115a88657621dc923cd209458473bdf5e50 (diff)
ensures the path reported by gems does exists
-rw-r--r--lib/rbot/rbotconfig.rb8
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