diff options
author | Asutosh Palai <asupalai@gmail.com> | 2016-05-23 21:14:04 +0530 |
---|---|---|
committer | Asutosh Palai <asupalai@gmail.com> | 2016-05-24 21:15:01 +0530 |
commit | 867e2d9c6cfc033f689340c2c592db9119dcaa8c (patch) | |
tree | 4b759b3ec547ad91a551cb3a1f2a66458692f36c /lib/bundler/source | |
parent | 00098cda3d4b73f3c74199434c889f20e05b0485 (diff) | |
download | bundler-867e2d9c6cfc033f689340c2c592db9119dcaa8c.tar.gz |
Added support for git install
Diffstat (limited to 'lib/bundler/source')
-rw-r--r-- | lib/bundler/source/git.rb | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 2bbb5092..9624f97c 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -86,12 +86,17 @@ module Bundler def install_path @install_path ||= begin git_scope = "#{base_name}-#{shortref_for_path(revision)}" - path = Bundler.install_path.join(git_scope) - if !path.exist? && Bundler.requires_sudo? - Bundler.user_bundle_path.join(Bundler.ruby_scope).join(git_scope) + if @options[:plugin] + path = Plugin.root.join("bundler", "gems", git_scope) else - path + path = Bundler.install_path.join(git_scope) + + if !path.exist? && Bundler.requires_sudo? + Bundler.user_bundle_path.join(Bundler.ruby_scope).join(git_scope) + else + path + end end end end @@ -169,7 +174,7 @@ module Bundler serialize_gemspecs_in(install_path) @copied = true end - generate_bin(spec) + generate_bin(spec) unless @options[:plugin] requires_checkout? ? spec.post_install_message : nil end @@ -200,10 +205,14 @@ module Bundler @cache_path ||= begin git_scope = "#{base_name}-#{uri_hash}" - if Bundler.requires_sudo? - Bundler.user_bundle_path.join("cache/git", git_scope) + if @options[:plugin] + Plugin.cache.join("bundler", "git", git_scope) else - Bundler.cache.join("git", git_scope) + if Bundler.requires_sudo? + Bundler.user_bundle_path.join("cache/git", git_scope) + else + Bundler.cache.join("git", git_scope) + end end end end @@ -227,8 +236,8 @@ module Bundler end def serialize_gemspecs_in(destination) - expanded_path = destination.expand_path(Bundler.root) - Dir["#{expanded_path}/#{@glob}"].each do |spec_path| + destination = destination.expand_path(Bundler.root) if destination.relative? + Dir["#{destination}/#{@glob}"].each do |spec_path| # Evaluate gemspecs and cache the result. Gemspecs # in git might require git or other dependencies. # The gemspecs we cache should already be evaluated. |