aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 18:54:15 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 17:08:51 +0900
commit43184056094af2495f05964c78bc517e07721802 (patch)
tree7c7da2130f8a145861a018500ba9282a5113f489 /spec/bundler
parent09455301ef81bc6207e6d3ba1034c35851575e18 (diff)
downloadruby-43184056094af2495f05964c78bc517e07721802.tar.gz
[bundler/bundler] Extract a `root_gemspec` local variable
https://github.com/bundler/bundler/commit/a4beba4cbf
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/support/path.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index 38d8ff8102..73d828cb5d 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -134,11 +134,12 @@ module Spec
def with_root_gemspec
if ruby_core?
+ root_gemspec = root.join("bundler.gemspec")
spec = Gem::Specification.load(gemspec.to_s)
spec.bindir = "libexec"
- File.open(root.join("bundler.gemspec").to_s, "w") {|f| f.write spec.to_ruby }
- yield(root.join("bundler.gemspec"))
- FileUtils.rm(root.join("bundler.gemspec"))
+ File.open(root_gemspec.to_s, "w") {|f| f.write spec.to_ruby }
+ yield(root_gemspec)
+ FileUtils.rm(root_gemspec)
else
yield(gemspec)
end