[Rubygems-developers] 1.3.2?

Luis Lavena luislavena at gmail.com
Sat Mar 21 09:17:26 EDT 2009


On Sat, Mar 21, 2009 at 12:52 AM, Daniel Berger <djberg96 at gmail.com> wrote:
> [snip]
>
> I think always escaping the URI is the better solution:
>
> --- remote_fetcher.old  Fri Mar 20 21:37:44 2009
> +++ remote_fetcher.rb   Fri Mar 20 21:38:30 2009
> @@ -85,17 +85,12 @@
>    local_gem_path = File.join cache_dir, gem_file_name
>
>    FileUtils.mkdir_p cache_dir rescue nil unless File.exist? cache_dir
> +
> +    # Always escape URI's to deal with potential spaces and such
>    unless URI::Generic === source_uri
> -      begin
> -        source_uri = URI.parse source_uri
> -      rescue URI::InvalidURIError
> -        if source_uri =~ /\A#{File::SEPARATOR}/o then # HACK mswin
> -          source_uri = URI.parse URI.escape(source_uri)
> -        else
> -          raise
> -        end
> -      end
> +      source_uri = URI.parse(URI.escape(source_uri))
>    end
> +
>    scheme = source_uri.scheme
>
>    # URI.parse gets confused by MS Windows paths with forward slashes.
>
> All tests pass.
>

But remote fetcher works? I mean, can we point to a local rubygems
repository using a PATH instead of a URL with file:// ?

Last time I've tried that (back in 2007) that didn't work on Windows.

> Unless anyone has any objections, I'm going to commit this at some point
> this weekend.
>

Except for the above note, everything looks good from my side :-)

> Regards,
>
> Dan
>

Thank you,
-- 
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


More information about the Rubygems-developers mailing list