aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-03-22 21:35:44 +0100
committerJosé Valim <jose.valim@plataformatec.com.br>2012-03-22 21:35:44 +0100
commitd389686b681732fe12edc8797333b01648914a56 (patch)
treef33fc929b1578ef2caa6b3c80b0c5730778fa2f6 /lib/bundler/source.rb
parentc8a738bd6c01b00abacd30fef86facd034602f48 (diff)
downloadbundler-d389686b681732fe12edc8797333b01648914a56.tar.gz
Ensure packaged path repos can be updated.
Diffstat (limited to 'lib/bundler/source.rb')
-rw-r--r--lib/bundler/source.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 63d3d4a3..46537edf 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -314,7 +314,10 @@ module Bundler
@name = options["name"]
@version = options["version"]
- @path = app_cache_path if has_app_cache?
+
+ # Stores the original path. If at any point we move to the
+ # cached directory, we still have the original path to copy from.
+ @original_path = @path
end
def remote!
@@ -368,16 +371,21 @@ module Bundler
def cache(spec)
return unless Bundler.settings[:cache_all]
- return if path.expand_path(Bundler.root).to_s.index(Bundler.root.to_s) == 0
+ return if @original_path.expand_path(Bundler.root).to_s.index(Bundler.root.to_s) == 0
FileUtils.rm_rf(app_cache_path)
- FileUtils.cp_r("#{path}/.", app_cache_path)
+ FileUtils.cp_r("#{@original_path}/.", app_cache_path)
end
def local_specs(*)
@local_specs ||= load_spec_files
end
- alias :specs :local_specs
+ def specs
+ if has_app_cache?
+ @path = app_cache_path
+ end
+ local_specs
+ end
private