ruby-changes:56460
From: Hiroshi <ko1@a...>
Date: Sun, 14 Jul 2019 15:40:57 +0900 (JST)
Subject: [ruby-changes:56460] Hiroshi SHIBATA: 4ce935cd5d (master): Removed FileUtils for file manipulations with module inclusion.
https://git.ruby-lang.org/ruby.git/commit/?id=4ce935cd5d From 4ce935cd5dde69b39bb98b8948d41e3afba81e33 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Sun, 14 Jul 2019 15:22:12 +0900 Subject: Removed FileUtils for file manipulations with module inclusion. diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index f21f069..34cdfae 100644 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -41,6 +41,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L41 # require 'fileutils' +include FileUtils $repositories = { rubygems: 'rubygems/rubygems', @@ -90,136 +91,136 @@ def sync_default_gems(gem) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L91 case gem when "rubygems" - FileUtils.rm_rf(%w[lib/rubygems* test/rubygems]) - FileUtils.cp_r(Dir.glob("#{upstream}/lib/rubygems*"), "lib") - FileUtils.cp_r("#{upstream}/test/rubygems", "test") + rm_rf(%w[lib/rubygems* test/rubygems]) + cp_r(Dir.glob("#{upstream}/lib/rubygems*"), "lib") + cp_r("#{upstream}/test/rubygems", "test") when "bundler" - FileUtils.rm_rf(%w[lib/bundler* libexec/bundler libexec/bundle spec/bundler man/bundle* man/gemfile*]) - FileUtils.cp_r(Dir.glob("#{upstream}/lib/bundler*"), "lib") - FileUtils.cp_r(Dir.glob("#{upstream}/exe/bundle*"), "libexec") - FileUtils.cp_r("#{upstream}/bundler.gemspec", "lib/bundler") - FileUtils.cp_r("#{upstream}/spec", "spec/bundler") - FileUtils.cp_r(Dir.glob("#{upstream}/man/*.{1,5,1\.txt,5\.txt,ronn}"), "man") - FileUtils.rm_rf(%w[spec/bundler/support/artifice/vcr_cassettes]) + rm_rf(%w[lib/bundler* libexec/bundler libexec/bundle spec/bundler man/bundle* man/gemfile*]) + cp_r(Dir.glob("#{upstream}/lib/bundler*"), "lib") + cp_r(Dir.glob("#{upstream}/exe/bundle*"), "libexec") + cp_r("#{upstream}/bundler.gemspec", "lib/bundler") + cp_r("#{upstream}/spec", "spec/bundler") + cp_r(Dir.glob("#{upstream}/man/*.{1,5,1\.txt,5\.txt,ronn}"), "man") + rm_rf(%w[spec/bundler/support/artifice/vcr_cassettes]) when "rdoc" - FileUtils.rm_rf(%w[lib/rdoc* test/rdoc libexec/rdoc libexec/ri]) - FileUtils.cp_r(Dir.glob("#{upstream}/lib/rdoc*"), "lib") - FileUtils.cp_r("#{upstream}/test", "test/rdoc") - FileUtils.cp_r("#{upstream}/rdoc.gemspec", "lib/rdoc") - FileUtils.cp_r("#{upstream}/exe/rdoc", "libexec") - FileUtils.cp_r("#{upstream}/exe/ri", "libexec") - FileUtils.rm_rf(%w[lib/rdoc/markdown.kpeg lib/rdoc/markdown/literals.kpeg lib/rdoc/rd/block_parser.ry lib/rdoc/rd/inline_parser.ry]) + rm_rf(%w[lib/rdoc* test/rdoc libexec/rdoc libexec/ri]) + cp_r(Dir.glob("#{upstream}/lib/rdoc*"), "lib") + cp_r("#{upstream}/test", "test/rdoc") + cp_r("#{upstream}/rdoc.gemspec", "lib/rdoc") + cp_r("#{upstream}/exe/rdoc", "libexec") + cp_r("#{upstream}/exe/ri", "libexec") + rm_rf(%w[lib/rdoc/markdown.kpeg lib/rdoc/markdown/literals.kpeg lib/rdoc/rd/block_parser.ry lib/rdoc/rd/inline_parser.ry]) `git checkout lib/rdoc/.document` when "reline" - FileUtils.rm_rf(%w[lib/reline* test/reline]) - FileUtils.cp_r(Dir.glob("#{upstream}/lib/reline*"), "lib") - FileUtils.cp_r("#{upstream}/test", "test/reline") - FileUtils.cp_r("#{upstream}/reline.gemspec", "lib/reline") + rm_rf(%w[lib/reline* test/reline]) + cp_r(Dir.glob("#{upstream}/lib/reline*"), "lib") + cp_r("#{upstream}/test", "test/reline") + cp_r("#{upstream}/reline.gemspec", "lib/reline") when "json" - FileUtils.rm_rf(%w[ext/json test/json]) - FileUtils.cp_r("#{upstream}/ext/json/ext", "ext/json") - FileUtils.cp_r("#{upstream}/tests", "test/json") - FileUtils.cp_r("#{upstream}/lib", "ext/json") - FileUtils.rm_rf(%[ext/json/lib/json/pure*]) - FileUtils.cp_r("#{upstream}/json.gemspec", "ext/json") - FileUtils.rm_rf(%w[ext/json/lib/json/ext]) + rm_rf(%w[ext/json test/json]) + cp_r("#{upstream}/ext/json/ext", "ext/json") + cp_r("#{upstream}/tests", "test/json") + cp_r("#{upstream}/lib", "ext/json") + rm_rf(%[ext/json/lib/json/pure*]) + cp_r("#{upstream}/json.gemspec", "ext/json") + rm_rf(%w[ext/json/lib/json/ext]) `git checkout ext/json/extconf.rb ext/json/parser/prereq.mk ext/json/generator/depend ext/json/parser/depend` when "psych" - FileUtils.rm_rf(%w[ext/psych test/psych]) - FileUtils.cp_r("#{upstream}/ext/psych", "ext") - FileUtils.cp_r("#{upstream}/lib", "ext/psych") - FileUtils.cp_r("#{upstream}/test/psych", "test") - FileUtils.rm_rf(%w[ext/psych/lib/org ext/psych/lib/psych.jar ext/psych/lib/psych_jars.rb]) - FileUtils.rm_rf(%w[ext/psych/lib/psych.{bundle,so} ext/psych/lib/2.*]) - FileUtils.rm_rf(["ext/psych/yaml/LICENSE"]) - FileUtils.cp_r("#{upstream}/psych.gemspec", "ext/psych") + rm_rf(%w[ext/psych test/psych]) + cp_r("#{upstream}/ext/psych", "ext") + cp_r("#{upstream}/lib", "ext/psych") + cp_r("#{upstream}/test/psych", "test") + rm_rf(%w[ext/psych/lib/org ext/psych/lib/psych.jar ext/psych/lib/psych_jars.rb]) + rm_rf(%w[ext/psych/lib/psych.{bundle,so} ext/psych/lib/2.*]) + rm_rf(["ext/psych/yaml/LICENSE"]) + cp_r("#{upstream}/psych.gemspec", "ext/psych") `git checkout ext/psych/depend` when "fiddle" - FileUtils.rm_rf(%w[ext/fiddle test/fiddle]) - FileUtils.cp_r("#{upstream}/ext/fiddle", "ext") - FileUtils.cp_r("#{upstream}/lib", "ext/fiddle") - FileUtils.cp_r("#{upstream}/test/fiddle", "test") - FileUtils.cp_r("#{upstream}/fiddle.gemspec", "ext/fiddle") + rm_rf(%w[ext/fiddle test/fiddle]) + cp_r("#{upstream}/ext/fiddle", "ext") + cp_r("#{upstream}/lib", "ext/fiddle") + cp_r("#{upstream}/test/fiddle", "test") + cp_r("#{upstream}/fiddle.gemspec", "ext/fiddle") `git checkout ext/fiddle/depend` - FileUtils.rm_rf(%w[ext/fiddle/lib/fiddle.{bundle,so}]) + rm_rf(%w[ext/fiddle/lib/fiddle.{bundle,so}]) when "stringio" - FileUtils.rm_rf(%w[ext/stringio test/stringio]) - FileUtils.cp_r("#{upstream}/ext/stringio", "ext") - FileUtils.cp_r("#{upstream}/test/stringio", "test") - FileUtils.cp_r("#{upstream}/stringio.gemspec", "ext/stringio") + rm_rf(%w[ext/stringio test/stringio]) + cp_r("#{upstream}/ext/stringio", "ext") + cp_r("#{upstream}/test/stringio", "test") + cp_r("#{upstream}/stringio.gemspec", "ext/stringio") `git checkout ext/stringio/depend ext/stringio/README.md` when "ioconsole" - FileUtils.rm_rf(%w[ext/io/console test/io/console]) - FileUtils.cp_r("#{upstream}/ext/io/console", "ext/io") - FileUtils.cp_r("#{upstream}/test/io/console", "test/io") - FileUtils.mkdir_p("ext/io/console/lib") - FileUtils.cp_r("#{upstream}/lib/io/console", "ext/io/console/lib") - FileUtils.cp_r("#{upstream}/io-console.gemspec", "ext/io/console") + rm_rf(%w[ext/io/console test/io/console]) + cp_r("#{upstream}/ext/io/console", "ext/io") + cp_r("#{upstream}/test/io/console", "test/io") + mkdir_p("ext/io/console/lib") + cp_r("#{upstream}/lib/io/console", "ext/io/console/lib") + cp_r("#{upstream}/io-console.gemspec", "ext/io/console") `git checkout ext/io/console/depend` when "dbm" - FileUtils.rm_rf(%w[ext/dbm test/dbm]) - FileUtils.cp_r("#{upstream}/ext/dbm", "ext") - FileUtils.cp_r("#{upstream}/test/dbm", "test") - FileUtils.cp_r("#{upstream}/dbm.gemspec", "ext/dbm") + rm_rf(%w[ext/dbm test/dbm]) + cp_r("#{upstream}/ext/dbm", "ext") + cp_r("#{upstream}/test/dbm", "test") + cp_r("#{upstream}/dbm.gemspec", "ext/dbm") `git checkout ext/dbm/depend` when "gdbm" - FileUtils.rm_rf(%w[ext/gdbm test/gdbm]) - FileUtils.cp_r("#{upstream}/ext/gdbm", "ext") - FileUtils.cp_r("#{upstream}/test/gdbm", "test") - FileUtils.cp_r("#{upstream}/gdbm.gemspec", "ext/gdbm") + rm_rf(%w[ext/gdbm test/gdbm]) + cp_r("#{upstream}/ext/gdbm", "ext") + cp_r("#{upstream}/test/gdbm", "test") + cp_r("#{upstream}/gdbm.gemspec", "ext/gdbm") `git checkout ext/gdbm/depend ext/gdbm/README` when "sdbm" - FileUtils.rm_rf(%w[ext/sdbm test/sdbm]) - FileUtils.cp_r("#{upstream}/ext/sdbm", "ext") - FileUtils.cp_r("#{upstream}/test/sdbm", "test") - FileUtils.cp_r("#{upstream}/sdbm.gemspec", "ext/sdbm") + rm_rf(%w[ext/sdbm test/sdbm]) + cp_r("#{upstream}/ext/sdbm", "ext") + cp_r("#{upstream}/test/sdbm", "test") + cp_r("#{upstream}/sdbm.gemspec", "ext/sdbm") `git checkout ext/sdbm/depend` when "etc" - FileUtils.rm_rf(%w[ext/etc test/etc]) - FileUtils.cp_r("#{upstream}/ext/etc", "ext") - FileUtils.cp_r("#{upstream}/test/etc", "test") - FileUtils.cp_r("#{upstream}/etc.gemspec", "ext/etc") + rm_rf(%w[ext/etc test/etc]) + cp_r("#{upstream}/ext/etc", "ext") + cp_r("#{upstream}/test/etc", "test") + cp_r("#{upstream}/etc.gemspec", "ext/etc") `git checkout ext/etc/depend` when "date" - FileUtils.rm_rf(%w[ext/date test/date]) - FileUtils.cp_r("#{upstream}/ext/date", "ext") - FileUtils.cp_r("#{upstream}/lib", "ext/date") - FileUtils.cp_r("#{upstream}/test/date", "test") - FileUtils.cp_r("#{upstream}/date.gemspec", "ext/date") + rm_rf(%w[ext/date test/date]) + cp_r("#{upstream}/ext/date", "ext") + cp_r("#{upstream}/lib", "ext/date") + cp_r("#{upstream}/test/date", "test") + cp_r("#{upstream}/date.gemspec", "ext/date") `git checkout ext/date/depend` - FileUtils.rm_rf(["ext/date/lib/date_core.bundle"]) + rm_rf(["ext/date/lib/date_core.bundle"]) when "zlib" - FileUtils.rm_rf(%w[ext/zlib test/zlib]) - FileUtils.cp_r("#{upstream}/ext/zlib", "ext") - FileUtils.cp_r("#{upstream}/test/zlib", "test") - FileUtils.cp_r("#{upstream}/zlib.gemspec", "ext/zlib") + rm_rf(%w[ext/zlib test/zlib]) + cp_r("#{upstream}/ext/zlib", "ext") + cp_r("#{upstream}/test/zlib", "test") + cp_r("#{upstream}/zlib.gemspec", "ext/zlib") `git checkout ext/zlib/depend` when "fcntl" - FileUtils.rm_rf(%w[ext/fcntl]) - FileUtils.cp_r("#{upstream}/ext/fcntl", "ext") - FileUtils.cp_r("#{upstream}/fcntl.gemspec" (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/