diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 14d7a3893d..477cc75546 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -398,6 +398,10 @@ module SyncDefaultGems upstream = File.join("..", "..", config.upstream) + unless File.exist?(upstream) + abort %[Expected '#{upstream}' (#{File.expand_path("#{upstream}")}) to be a directory, but it didn't exist.] + end + config.mappings.each do |src, dst| rm_rf(dst) end @@ -798,26 +802,6 @@ module SyncDefaultGems return true end - 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("#{upstream}/lib/*"), "lib") - tests = if File.directory?("test/#{repo}") - "test/#{repo}" - else - "test/test_#{repo}.rb" - end - 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("#{upstream}/#{repo}.gemspec", "#{gemspec}") - end - def update_default_gems(gem, release: false) config = REPOSITORIES[gem] author, repository = config.upstream.split('/')