summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorMatthias Hecker <mail@apoc.cc>2020-03-27 22:31:25 +0100
committerMatthias Hecker <mail@apoc.cc>2020-03-27 22:31:25 +0100
commit7f42c4523570cd48e67a889aea933a277d7d2a31 (patch)
treea2d621530ef3f9f9d7195cb87c55044277c390cc /lib/rbot
parentd182bb3dc2451d963792e58cf888ac001c524aaf (diff)
gem: support for newest ruby versions
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/rbotconfig.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rbot/rbotconfig.rb b/lib/rbot/rbotconfig.rb
index eb55f965..d6f6bcde 100644
--- a/lib/rbot/rbotconfig.rb
+++ b/lib/rbot/rbotconfig.rb
@@ -33,9 +33,9 @@ class Bot
version = $version
end
debug "loaded rubygems, looking for rbot version #{$version} (rbot-#{version})"
- gemname, gem = Gem.source_index.find{|name, spec| spec.name == 'rbot' && spec.version.version == version}
- debug "got gem #{gem}"
- if gem && path = gem.full_gem_path
+ gem = Gem::Specification.find{|spec| spec.name == 'rbot' && spec.version.version == version}
+ if gem
+ path = gem.full_gem_path
debug "installed via rubygems to #{path}"
@@datadir = "#{path}/data/rbot"
@@coredir = "#{path}/lib/rbot/core"