1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Extract a root_gemspec local variable

https://github.com/bundler/bundler/commit/a4beba4cbf
This commit is contained in:
David Rodríguez 2019-08-15 18:54:15 +02:00 committed by Hiroshi SHIBATA
parent 09455301ef
commit 4318405609
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -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