зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Refactor `set_paths!`
The method has two different concerns not straightforward to distinguish. One is to set a new `install_path`, which is done by setting the `@install_path` instance variable, and invalidating the `local_specs` memoization, so that the next time they are picked from the new location. The other one is to set a new `cache_path` which is done by setting the `@cache_path` instance variable, and invalidating the `git_proxy` memoization, so that the next git proxy uses the new cache location. This commit splits the logic so that this is easier to understand. https://github.com/rubygems/rubygems/commit/55904094e8
This commit is contained in:
Родитель
26b1c7ed16
Коммит
b1db07074b
|
@ -302,8 +302,18 @@ module Bundler
|
|||
end
|
||||
|
||||
def set_paths!(path)
|
||||
@local_specs = @git_proxy = nil
|
||||
@cache_path = @install_path = path
|
||||
set_cache_path!(path)
|
||||
set_install_path!(path)
|
||||
end
|
||||
|
||||
def set_cache_path!(path)
|
||||
@git_proxy = nil
|
||||
@cache_path = path
|
||||
end
|
||||
|
||||
def set_install_path!(path)
|
||||
@local_specs = nil
|
||||
@install_path = path
|
||||
end
|
||||
|
||||
def has_app_cache?
|
||||
|
|
Загрузка…
Ссылка в новой задаче