On Mar 25, 2008, at 18:36 PM, Luis Lavena wrote:
> On Tue, Mar 25, 2008 at 8:51 PM, Eric Hodel <[EMAIL PROTECTED]>  
> wrote:
>> On Mar 23, 2008, at 21:01 PM, Luis Lavena wrote:
>>> Now, 'gem list' do not find the installed gem, unless I change
>>> GEM_HOME definition to use File::SEPARATOR instead of
>>> File::ALT_SEPARATOR...
>>
>> I wonder, try:
>>
>> p Dir["D:\\Users\\Luis\\.gems/specifications"]
>>
>> vs:
>>
>> p Dir["D:/Users/Luis/.gems/specifications"]
>>
>> Maybe mixing SEPARATOR and ALT_SEPARATOR confuses something inside  
>> ruby.
>>
>
> Daniel was correct:
>
> irb(main):001:0> p Dir["D:\\Users\\Luis\\.gems/specifications"]
> []
> => nil
> irb(main):002:0> p Dir["D:/Users/Luis/.gems/specifications"]
> ["D:/Users/Luis/.gems/specifications"]


Will this patch work?

Index: lib/rubygems.rb
===================================================================
--- lib/rubygems.rb     (revision 1650)
+++ lib/rubygems.rb     (working copy)
@@ -523,6 +521,7 @@ module Gem
    # Set the Gem home directory (as reported by Gem.dir).

    def self.set_home(home)
+    home = home.gsub File::ALT_SEPARATOR, File::SEPARATOR if  
File::ALT_SEPARATOR
      @gem_home = home
      ensure_gem_subdirectories(@gem_home)
    end
@@ -535,6 +534,13 @@ module Gem
    def self.set_paths(gpaths)
      if gpaths
        @gem_path = gpaths.split(File::PATH_SEPARATOR)
+
+      if File::ALT_SEPARATOR then
+        @gem_path.map do |path|
+          path.gsub File::ALT_SEPARATOR, File::SEPARATOR
+        end
+      end
+
        @gem_path << Gem.dir
      else
        @gem_path = [Gem.dir]

_______________________________________________
Rubygems-developers mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to