Sha256: 6879d9450e07aa4f7e399dfa4c1807395818184a0e6dd374f2096f19a825cded
Contents?: true
Size: 612 Bytes
Versions: 92
Compression:
Stored size: 612 Bytes
Contents
module Bundler class AnonymizableURI attr_reader :original_uri, :without_credentials 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 def apply_auth(uri, auth = nil) if auth && uri.userinfo.nil? uri = uri.dup uri.userinfo = auth end uri end def remove_auth(uri) if uri.userinfo uri = uri.dup uri.user = uri.password = nil end uri end end end
Version data entries
92 entries across 64 versions & 4 rubygems