[Rubygems-developers] Gem sources

Mehr, Assaph (Assaph) assaph at avaya.com
Mon Jul 19 00:58:54 EDT 2004


Hi All,
 
Do to a bug in open-uri on windows (doesn't play nice with the proxy) I
can't seem to use gems.
My solution was to run gem_server on my linux box and to patch gems to
look at at it. Here's a patch to add a "-s/--source" option to the gem
commands.
 
HTH,
Assaph
 
c:\langs\ruby\apps>diff -u -r rubygems.orig rubygems
diff -u -r rubygems.orig/lib/rubygems/command.rb
rubygems/lib/rubygems/command.rb
--- rubygems.orig/lib/rubygems/command.rb       2004-07-05
17:12:13.000000000 +1000
+++ rubygems/lib/rubygems/command.rb    2004-07-19 14:43:24.757511400
+1000
@@ -170,6 +170,11 @@
       end
     end
 
+    add_common_option('-s', '--source URL', 'Use URL as the remote
source for gems') do |value, options|
+      require_gem("sources")
+      Gem.sources.clear
+      Gem.sources << value
+    end
     add_common_option('-p', '--[no-]http-proxy [URL]', 'Use HTTP proxy
for remote operations') do |value, options|
       options[:http_proxy] = (value == false) ? :no_proxy : value
     end
diff -u -r rubygems.orig/packages/sources/lib/sources.rb
rubygems/packages/sources/lib/sources.rb
--- rubygems.orig/packages/sources/lib/sources.rb       2004-04-21
10:23:14.000000000 +1000
+++ rubygems/packages/sources/lib/sources.rb    2004-07-19
14:45:03.895262100 +1000
@@ -1,5 +1,6 @@
 module Gem
+  @sources = ["http://gems.rubyforge.org"]
   def self.sources
-    ["http://gems.rubyforge.org"]
+    @sources
   end
 end
Only in rubygems/packages/sources: sources-0.0.1.gem
 
 

If you're interested, I thought of making a ppm-like interface to ruby
gems (pending my limited free time :).

Cheers,
Assaph

  _____  

Assaph Mehr 
Email: assaph at avaya.com
Phone: +61-2-9352 9247
Fax: +61-2-9352 9247 	Auslabs (Avaya Labs Australia)
Level 3, 123 Epping Rd, North Ryde, NSW 2113
Web: http://www.avaya.com <http://www.avaya.com/>  

  _____  

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rubygems-developers/attachments/20040719/5f89d385/attachment.htm


More information about the Rubygems-developers mailing list