summaryrefslogtreecommitdiff
path: root/tool/sync_default_gems.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-04-21 13:53:07 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-11 11:29:41 +0900
commit7dccc4ef8aeb7b07280ba92ba34ef04bfbf7148d (patch)
treecbb152272a72f7dbd37493ca0e241664625ab951 /tool/sync_default_gems.rb
parentcc4d8d037cd49ff338cc32969295c32ce188e384 (diff)
Properly synchronize bundler gemspec too
By making the necessary modifications automatically.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4367
Diffstat (limited to 'tool/sync_default_gems.rb')
-rw-r--r--tool/sync_default_gems.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 0a5761a176..cac0c78cac 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -98,12 +98,18 @@ def sync_default_gems(gem)
rm_rf(%w[lib/bundler lib/bundler.rb libexec/bundler libexec/bundle spec/bundler tool/bundler/*])
cp_r(Dir.glob("#{upstream}/bundler/lib/bundler*"), "lib")
cp_r(Dir.glob("#{upstream}/bundler/exe/bundle*"), "libexec")
- cp_r("#{upstream}/bundler/bundler.gemspec", "lib/bundler")
+
+ gemspec_content = File.readlines("#{upstream}/bundler/bundler.gemspec").map do |line|
+ next if line =~ /extra_rdoc_files/
+
+ line.gsub("bundler.gemspec", "lib/bundler/bundler.gemspec").gsub('"exe"', '"libexec"')
+ end.compact.join
+ File.write("lib/bundler/bundler.gemspec", gemspec_content)
+
cp_r("#{upstream}/bundler/spec", "spec/bundler")
cp_r(Dir.glob("#{upstream}/bundler/tool/bundler/test_gems*"), "tool/bundler")
cp_r(Dir.glob("#{upstream}/bundler/tool/bundler/rubocop_gems*"), "tool/bundler")
cp_r(Dir.glob("#{upstream}/bundler/tool/bundler/standard_gems*"), "tool/bundler")
- `git checkout lib/bundler/bundler.gemspec`
rm_rf(%w[spec/bundler/support/artifice/vcr_cassettes])
when "rdoc"
rm_rf(%w[lib/rdoc lib/rdoc.rb test/rdoc libexec/rdoc libexec/ri])