lib/bundler/source/rubygems.rb in bundler-1.6.3 vs lib/bundler/source/rubygems.rb in bundler-1.6.4
- old
+ new
@@ -48,11 +48,13 @@
s
end
def to_lock
out = "GEM\n"
- out << remotes.map {|r| " remote: #{r}\n" }.join
+ out << remotes.map { |remote|
+ " remote: #{suppress_configured_credentials remote}\n"
+ }.join
out << " specs:\n"
end
def to_s
remote_names = self.remotes.map { |r| r.to_s }.join(', ')
@@ -179,9 +181,18 @@
uri = uri.to_s
uri = "#{uri}/" unless uri =~ %r'/$'
uri = URI(uri)
raise ArgumentError, "The source must be an absolute URI" unless uri.absolute?
uri
+ end
+
+ def suppress_configured_credentials(remote)
+ remote_nouser = remote.tap { |uri| uri.user = uri.password = nil }.to_s
+ if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
+ remote_nouser
+ else
+ remote
+ end
end
def fetch_specs
# remote_specs usually generates a way larger Index than the other
# sources, and large_idx.use small_idx is way faster than