summaryrefslogtreecommitdiff
path: root/lib/bundler/source_list.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-01-17 21:47:32 +0100
committergit <svn-admin@ruby-lang.org>2022-08-06 15:41:45 +0900
commitaf40af45b28a9576d5ae6a46d9678c0e3d6be005 (patch)
tree6fb0c0c4f86628c02881c3423107601b052022d4 /lib/bundler/source_list.rb
parent27173e3735ff509dc8d9cc9b410baff84adf57dc (diff)
[rubygems/rubygems] Extract `SourceList#get_with_fallback`
https://github.com/rubygems/rubygems/commit/9dbc4757a8
Diffstat (limited to 'lib/bundler/source_list.rb')
-rw-r--r--lib/bundler/source_list.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index a4773397c7..6ea2910d18 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -101,6 +101,10 @@ module Bundler
source_list_for(source).find {|s| equivalent_source?(source, s) }
end
+ def get_with_fallback(source)
+ get(source) || default_source
+ end
+
def lock_sources
lock_other_sources + lock_rubygems_sources
end