From 2c590a72a388fcada1fd366219b7a9bea29486cf Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Wed, 5 Jan 2011 19:59:52 -0800 Subject: [PATCH] Get the gem load path from... Gem! I know, it is shocking. --- lib/qwandry/configuration/default.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/qwandry/configuration/default.rb b/lib/qwandry/configuration/default.rb index 03ef76f..1a8b456 100644 --- a/lib/qwandry/configuration/default.rb +++ b/lib/qwandry/configuration/default.rb @@ -10,11 +10,10 @@ end # Register the default ruby gems configuration: register_if_present :gem do - # Get the gem paths from the ruby load paths: - paths = ($:).grep(/gems/).map{|p| p[/.+\/gems\//]}.uniq + require 'rubygems' unless defined? Gem - # Add all the rubygems' paths: - add paths + # Add rubygems path: + add File.join(Gem.dir, 'gems') end # Register a perl configuration: