summaryrefslogtreecommitdiff
path: root/lib/bundler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r--lib/bundler.rb32
1 files changed, 26 insertions, 6 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 5e3b601f16..2ad1d15383 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -87,10 +87,27 @@ module Bundler
end
def bundle_path
- # STDERR.puts settings.path
@bundle_path ||= Pathname.new(settings.path).expand_path(root)
end
+ def bundle_install_path
+ if install_path?
+ @bundle_install_path = install_path
+ else
+ @bundle_install_path ||= Pathname.new(@settings.install_path).expand_path(root)
+ end
+ end
+
+ def install_path
+ install_path? ?
+ Pathname.new(configure_install_path) :
+ home.join("gems")
+ end
+
+ def install_path?
+ @settings.install_path?
+ end
+
def bin_path
@bin_path ||= begin
path = settings[:bin] || "bin"
@@ -151,10 +168,6 @@ module Bundler
bundle_path.join("bundler")
end
- def install_path
- home.join("gems")
- end
-
def specs_path
bundle_path.join("specifications")
end
@@ -278,6 +291,13 @@ module Bundler
lockfile.rmtree
end
end
-
+ def configure_install_path
+ if @settings.install_path?
+ @settings[:install_path] = @settings.install_path
+ else
+ @settings[:install_path] = home.join("gems")
+ end
+ @settings[:install_path]
+ end
end
end