File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class Rubygems < Source
10
10
# Ask for X gems per API request
11
11
API_REQUEST_SIZE = 50
12
12
13
- attr_reader :remotes
13
+ attr_accessor :remotes
14
14
15
15
def initialize ( options = { } )
16
16
@options = options
@@ -20,9 +20,10 @@ def initialize(options = {})
20
20
@allow_cached = false
21
21
@allow_local = options [ "allow_local" ] || false
22
22
@checksum_store = Checksum ::Store . new
23
- @original_remotes = nil
24
23
25
24
Array ( options [ "remotes" ] ) . reverse_each { |r | add_remote ( r ) }
25
+
26
+ @lockfile_remotes = @remotes if options [ "from_lockfile" ]
26
27
end
27
28
28
29
def caches
@@ -92,12 +93,7 @@ def options
92
93
93
94
def self . from_lock ( options )
94
95
options [ "remotes" ] = Array ( options . delete ( "remote" ) ) . reverse
95
- new ( options )
96
- end
97
-
98
- def remotes = ( new_remotes )
99
- @original_remotes = @remotes
100
- @remotes = new_remotes
96
+ new ( options . merge ( "from_lockfile" => true ) )
101
97
end
102
98
103
99
def to_lock
@@ -470,7 +466,7 @@ def cache_path
470
466
private
471
467
472
468
def lockfile_remotes
473
- @original_remotes || credless_remotes
469
+ @lockfile_remotes || credless_remotes
474
470
end
475
471
476
472
# Checks if the requested spec exists in the global cache. If it does,
Original file line number Diff line number Diff line change 419
419
420
420
lockfile lockfile_without_credentials
421
421
422
+ # when not re-resolving
422
423
bundle "install" , artifice : "endpoint_strict_basic_authentication" , quiet : true
424
+ expect ( lockfile ) . to eq lockfile_without_credentials
425
+
426
+ # when re-resolving with full unlock
427
+ bundle "update" , artifice : "endpoint_strict_basic_authentication"
428
+ expect ( lockfile ) . to eq lockfile_without_credentials
423
429
430
+ # when re-resolving without ful unlocking
431
+ bundle "update rack-obama" , artifice : "endpoint_strict_basic_authentication"
424
432
expect ( lockfile ) . to eq lockfile_without_credentials
425
433
end
426
434
You can’t perform that action at this time.
0 commit comments