[Rubygems-developers] Gem sources

Chad Fowler chad at chadfowler.com
Mon Jul 19 07:10:49 EDT 2004


On Jul 19, 2004, at 12:58 AM, Mehr, Assaph (Assaph) wrote:

> 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.
>  


Hopefully Ruby 1.8.2 will come out soon.  They've fixed that bug quite 
a while ago, but it's not in the official release yet.

Thanks for the patch!  It's another thing we can scratch off the TODO 
list!

Chad

> 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
>  
> _______________________________________________
> Rubygems-developers mailing list
> Rubygems-developers at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rubygems-developers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 7944 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20040719/ea466112/attachment-0001.bin


More information about the Rubygems-developers mailing list