From 7f42c4523570cd48e67a889aea933a277d7d2a31 Mon Sep 17 00:00:00 2001 From: Matthias Hecker Date: Fri, 27 Mar 2020 22:31:25 +0100 Subject: gem: support for newest ruby versions --- lib/rbot/rbotconfig.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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" -- cgit v1.2.3