class Bundler::AnonymizableURI - bundler-1.9.9 Documentation

# class Bundler::AnonymizableURI

### Attributes

original_uri[R]
without_credentials[R]

### Public Class Methods

new(original_uri, fallback_auth = nil) click to toggle source

    # File lib/bundler/anonymizable_uri.rb, line 6
    def initialize(original_uri, fallback_auth = nil)
      @original_uri = apply_auth(original_uri, fallback_auth).freeze
      @without_credentials = remove_auth(@original_uri).freeze
    end

### Private Instance Methods

apply_auth(uri, auth = nil) click to toggle source

    # File lib/bundler/anonymizable_uri.rb, line 13
    def apply_auth(uri, auth = nil)
      if auth && uri.userinfo.nil?
        uri = uri.dup
        uri.userinfo = auth
      end

      uri
    end

remove_auth(uri) click to toggle source

    # File lib/bundler/anonymizable_uri.rb, line 22
    def remove_auth(uri)
      if uri.userinfo
        uri = uri.dup
        uri.user = uri.password = nil
      end

      uri
    end