diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-07-24 13:32:57 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-07-24 13:32:57 -0500 |
commit | 323d6d2e09678f1c3a1653b0bdf1de2f05a86410 (patch) | |
tree | bc1791d02dce9c0dc0827220b7a6bd8bb396a1dd /spec/support/builders.rb | |
parent | 217b25925ad6f6c67cf7b27c994a70e5098d58f5 (diff) | |
download | bundler-323d6d2e09678f1c3a1653b0bdf1de2f05a86410.tar.gz |
Untangle the system gem path and the default bundle path in the specs
Diffstat (limited to 'spec/support/builders.rb')
-rw-r--r-- | spec/support/builders.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 6b15cffe5a..af91c5e6a7 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -718,18 +718,21 @@ module Spec class GemBuilder < LibBuilder def _build(opts) lib_path = super(opts.merge(:path => @context.tmp(".tmp/#{@spec.full_name}"), :no_default => opts[:no_default])) + destination = opts[:path] || _default_path Dir.chdir(lib_path) do - destination = opts[:path] || _default_path FileUtils.mkdir_p(destination) @spec.authors = ["that guy"] if !@spec.authors || @spec.authors.empty? Bundler.rubygems.build(@spec, opts[:skip_validation]) - if opts[:to_system] - `gem install --ignore-dependencies --no-ri --no-rdoc #{@spec.full_name}.gem` - else - FileUtils.mv("#{@spec.full_name}.gem", opts[:path] || _default_path) - end + end + gem_path = File.expand_path("#{@spec.full_name}.gem", lib_path) + if opts[:to_system] + @context.system_gems gem_path, :keep_path => true + elsif opts[:to_bundle] + @context.system_gems gem_path, :path => :bundle_path, :keep_path => true + else + FileUtils.mv(gem_path, destination) end end |