diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-10-04 22:55:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-10-04 22:55:27 +0900 |
commit | ef4ba517e47cba48c545ff3ce9f06bb56dd63df1 (patch) | |
tree | 62a5db1180443227feadc049921069880c509375 /tool/sync_default_gems.rb | |
parent | 0406898a3f1d157db0ccf039fe9844c221c65f95 (diff) |
Adjusted default gems paths
* sync_default_gems.rb (sync_lib): sync from the same directory as
sync_default_gems.
Diffstat (limited to 'tool/sync_default_gems.rb')
-rw-r--r-- | tool/sync_default_gems.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index b4e11d9c04..236c16a184 100644 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -306,7 +306,7 @@ def sync_default_gems(gem) cp_r("#{upstream}/bigdecimal.gemspec", "ext/bigdecimal") `git checkout ext/bigdecimal/depend` else - sync_lib gem + sync_lib gem, upstream end end @@ -412,24 +412,24 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil) end end -def sync_lib(repo) - unless File.directory?("../#{repo}") - abort %[Expected '../#{repo}' \(#{File.expand_path("../#{repo}")}\) to be a directory, but it wasn't.] +def sync_lib(repo, upstream = nil) + unless upstream and File.directory?(upstream) or File.directory?(upstream = "../#{repo}") + abort %[Expected '#{upstream}' \(#{File.expand_path("#{upstream}")}\) to be a directory, but it wasn't.] end rm_rf(["lib/#{repo}.rb", "lib/#{repo}/*", "test/test_#{repo}.rb"]) - cp_r(Dir.glob("../#{repo}/lib/*"), "lib") + cp_r(Dir.glob("#{upstream}/lib/*"), "lib") tests = if File.directory?("test/#{repo}") "test/#{repo}" else "test/test_#{repo}.rb" end - cp_r("../#{repo}/#{tests}", "test") if File.exist?("../#{repo}/#{tests}") + cp_r("#{upstream}/#{tests}", "test") if File.exist?("#{upstream}/#{tests}") gemspec = if File.directory?("lib/#{repo}") "lib/#{repo}/#{repo}.gemspec" else "lib/#{repo}.gemspec" end - cp_r("../#{repo}/#{repo}.gemspec", "#{gemspec}") + cp_r("#{upstream}/#{repo}.gemspec", "#{gemspec}") end def update_default_gems(gem) |