diff options
author | Andre Arko <andre@arko.net> | 2013-10-17 09:30:10 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2013-10-17 09:30:10 -0700 |
commit | 49aa5c5b13fd0e454a74e79de759a3c818fd68e2 (patch) | |
tree | 4aed5c8f29eb37815ce4e9e3d5fb0424dfe28579 /lib/bundler/source.rb | |
parent | 31cc97aaac0263671ee2bc6b75ffc45b33b27157 (diff) | |
download | bundler-49aa5c5b13fd0e454a74e79de759a3c818fd68e2.tar.gz |
move RubygemsMirror.to_uri to Source.mirror_for
Diffstat (limited to 'lib/bundler/source.rb')
-rw-r--r-- | lib/bundler/source.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index c75599f4db..a0977b8580 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -1,7 +1,16 @@ module Bundler module Source autoload :Rubygems, 'bundler/source/rubygems' - autoload :Path, 'bundler/source/path' - autoload :Git, 'bundler/source/git' + autoload :Path, 'bundler/source/path' + autoload :Git, 'bundler/source/git' + + def self.mirror_for(uri) + # Settings keys are all downcased + mirrors = Bundler.settings.gem_mirrors + normalized_key = URI(uri.to_s.downcase) + + mirrors[normalized_key] || URI(uri) + end + end end |