Sha256: 349e790beace4e1273a399140fdace6f66991d5a42416e4f62a712f9da849c52

Contents?: true

Size: 488 Bytes

Versions: 11

Compression:

Stored size: 488 Bytes

Contents

module Bundler
  class RubygemsMirror

    private

    def self.mirrors
      @mirrors ||= Bundler.settings.all.inject({}) do |h, k|
        if k =~ /^mirror./
          uri = add_slash(k.sub(/^mirror./, ''))
          h[uri] = URI.parse(Bundler.settings[k])
        end
        h
      end
    end

    def self.add_slash(uri)
      uri = uri.to_s
      uri =~ /\/$/ ? uri : uri + '/'
    end

    public

    def self.to_uri(uri)
      mirrors[add_slash(uri)] || uri
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nexus-1.2.1 lib/bundler/rubygems_mirror.rb
nexus-1.2.0 lib/bundler/rubygems_mirror.rb
nexus-1.1.0 lib/bundler/rubygems_mirror.rb
nexus-1.0.1 lib/bundler/rubygems_mirror.rb
nexus-1.0.0 lib/bundler/rubygems_mirror.rb
nexus-0.2.5 lib/bundler/rubygems_mirror.rb
nexus-0.2.4 lib/bundler/rubygems_mirror.rb
nexus-0.2.3 lib/bundler/rubygems_mirror.rb
nexus-0.2.2 lib/bundler/rubygems_mirror.rb
nexus-0.2.0 lib/bundler/rubygems_mirror.rb
nexus-0.1.0 lib/bundler/rubygems_mirror.rb