]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
ensures the path reported by gems does exists
authorMatthias Hecker <mail@apoc.cc>
Wed, 22 Apr 2020 12:40:12 +0000 (14:40 +0200)
committerMatthias Hecker <mail@apoc.cc>
Wed, 22 Apr 2020 12:40:12 +0000 (14:40 +0200)
lib/rbot/rbotconfig.rb

index d6f6bcdeca67dfa74a38d2fac8f82f152991aba6..894a1b65d7a9d5b0780d5f48aded2c39d3eff9f8 100644 (file)
@@ -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