[Rubygems-developers] Problems with RemoteInstaller

Mauricio Fernández mfp at acm.org
Sat Nov 12 19:11:37 EST 2005


On Sat, Nov 12, 2005 at 07:04:18PM +0100, Florian Frank wrote:
> Hello,
> 
> I hade some problems using the Rubygems RemoteInstaller. It requires a 
> 'rubygems/open-uri.rb', that contains a copy of the 'open-uri.rb' file, 
> that comes with Ruby. I think this was done to be compatible with older 
> versions of Ruby.

It was a workaround for a bug in an older open-uri (as opposed to a way to
use open-uri in outdated Ruby setups).

>      def open_uri_or_path(uri, &block)
> -      require 'rubygems/open-uri'
> +      begin
> +        require 'open-uri'
> +      rescue LoadError
> +        require 'rubygems/open-uri'
> +      end

If you go that way, just
  require 'open-uri'
would make more sense.

-- 
Mauricio Fernandez


More information about the Rubygems-developers mailing list