-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Permit absolute paths in cache_path setting #5628
Conversation
spec/cache/cache_path_spec.rb
Outdated
@@ -23,12 +23,4 @@ | |||
expect(bundled_app("vendor/cache-foo/rack-1.0.0.gem")).to exist | |||
end | |||
end | |||
|
|||
context "when given an absolute path" do | |||
it "exits with non-zero status" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change this to a test that it packages correctly?
lib/bundler/settings.rb
Outdated
path = self[:cache_path] || "vendor/cache" | ||
raise InvalidOption, "Cache path must be relative to the bundle path" if path.start_with?("/") | ||
path | ||
self[:cache_path] || "vendor/cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The begin
block is no longer necessary here
DEFAULT_VENDOR_CACHE_PATH = "vendor/cache"
...
def app_cache_path
@app_cache_path ||= self[:cache_path] || DEFAULT_VENDOR_CACHE_PATH
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've held off extracting "vendor/cache"
into a constant for now because it didn't appear to fit with the rest of the file. It makes sense to do but perhaps as part of a separate wider scoped refactor.
08ead2f
to
8fce595
Compare
👍🏻 |
@bundlerbot r+ |
📌 Commit 8fce595 has been approved by |
Permit absolute paths in cache_path setting Removes check on leading `/` from `cache_path` and updates tests. Fixes #5627
☀️ Test successful - status-travis |
Removes check on leading
/
fromcache_path
and updates tests.Fixes #5627