diff options
author | The Bundler Bot <bot@bundler.io> | 2017-05-02 22:29:15 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-05-02 22:29:15 +0000 |
commit | af277266db3fac8c0dd52c8bb0bd2ba63ae78131 (patch) | |
tree | 9c62037198d7e0debf73ee92b2591922f004a8e2 | |
parent | 1624e5775acab1b18743aabfb4ed2045d368d9e9 (diff) | |
parent | 8fce5958b8191080a1aa911fc0136b4b2e8591d5 (diff) | |
download | bundler-af277266db3fac8c0dd52c8bb0bd2ba63ae78131.tar.gz |
Auto merge of #5628 - mal:permit-absolute-cache-path, r=segiddins
Permit absolute paths in cache_path setting
Removes check on leading `/` from `cache_path` and updates tests.
Fixes #5627
-rw-r--r-- | lib/bundler/settings.rb | 6 | ||||
-rw-r--r-- | spec/cache/cache_path_spec.rb | 7 |
2 files changed, 4 insertions, 9 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 3612023cb2..d736de18aa 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -213,11 +213,7 @@ module Bundler end def app_cache_path - @app_cache_path ||= begin - path = self[:cache_path] || "vendor/cache" - raise InvalidOption, "Cache path must be relative to the bundle path" if path.start_with?("/") - path - end + @app_cache_path ||= self[:cache_path] || "vendor/cache" end private diff --git a/spec/cache/cache_path_spec.rb b/spec/cache/cache_path_spec.rb index ec6d6e312a..c9ec4218ae 100644 --- a/spec/cache/cache_path_spec.rb +++ b/spec/cache/cache_path_spec.rb @@ -24,11 +24,10 @@ RSpec.describe "bundle package" do end end - context "when given an absolute path" do - it "exits with non-zero status" do + context "with absolute --cache-path" do + it "caches gems at given path" do bundle :package, "cache-path" => "/tmp/cache-foo" - expect(out).to match(/must be relative/) - expect(exitstatus).to eq(15) if exitstatus + expect(bundled_app("/tmp/cache-foo/rack-1.0.0.gem")).to exist end end end |