X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Frbotconfig.rb;h=226f687ed9bfe3310241d1cfcf26f72e547ef34d;hb=8246bd135ebf319beae8fec39620f4c4c7e54601;hp=fad7b032963b00d37629cb0e67e8a347e2f3360e;hpb=dd0b318cfd3df017b1ec4e44afc2f4e412fd2033;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/rbotconfig.rb b/lib/rbot/rbotconfig.rb index fad7b032..226f687e 100644 --- a/lib/rbot/rbotconfig.rb +++ b/lib/rbot/rbotconfig.rb @@ -4,15 +4,18 @@ module Irc # setup pkg-based configuration - i.e. where were we installed to, where # are our data files, etc. begin + debug "trying to load rubygems" require 'rubygems' + debug "loaded rubygems, looking for 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 debug "installed via rubygems to #{path}" @@datadir = "#{path}/data/rbot" else debug "not installed via rubygems" end - rescue LoadError + rescue LoadError,NameError,NoMethodError debug "no rubygems installed" end