Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Modify installation path
Browse files Browse the repository at this point in the history
Conflicts:
	lib/bundler/source_list.rb
  • Loading branch information
Stefan Lance committed Jul 20, 2015
1 parent d8aec22 commit a3fa32a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/bundler/settings.rb
Expand Up @@ -12,6 +12,10 @@ def initialize(root = nil)
@global_config = load_config(global_config_file)
end

def root
@root
end

def [](name)
key = key_for(name)
value = (@local_config[key] || ENV[key] || @global_config[key] || DEFAULT_CONFIG[name])
Expand Down Expand Up @@ -141,7 +145,7 @@ def path

if path = self[:path]
path = "#{path}/#{Bundler.ruby_scope}" if path != Bundler.rubygems.gem_dir
File.expand_path(path)
path
else
File.join(@root, Bundler.ruby_scope)
end
Expand Down
17 changes: 15 additions & 2 deletions lib/bundler/source/rubygems.rb
Expand Up @@ -126,8 +126,21 @@ def install(spec, opts = {})
install_path = Bundler.tmp(spec.full_name)
bin_path = install_path.join("bin")
else
install_path = File.expand_path(Bundler.settings.path)
bin_path = Bundler.system_bindir

set_path = Bundler.settings.path

# TODO: document exactly what's going on here and in Bundler.settings.path
if set_path == File.join(Bundler.settings.root, Bundler.ruby_scope) # ?
install_path = Bundler.settings.path
elsif set_path == Bundler.rubygems.gem_dir # system gems path
install_path = Bundler.settings.path
elsif Pathname.new(set_path).absolute? # all other absolute paths
install_path = Bundler.settings.path
else # all relative paths
install_path = File.join(Bundler::root, Bundler.settings.path)
end

bin_path = Bundler.system_bindir
end

installed_spec = nil
Expand Down
1 change: 1 addition & 0 deletions spec/install/path_spec.rb
Expand Up @@ -92,6 +92,7 @@ def set_bundle_path(type, location)
# FIXME: If the bundle_path is `"vendor"` instead of
# `bundled_app("vendor").to_s`, this spec fails. As is, this spec
# may not test what happens when `path` is relative.

bundle "config path vendor"
#set_bundle_path(type, bundled_app("vendor").to_s)

Expand Down

0 comments on commit a3fa32a

Please sign in to comment.