From d9699fadf8b7031fb92854106d7703b8370eb95f Mon Sep 17 00:00:00 2001 From: duerst Date: Sun, 6 Jan 2019 11:41:12 +0000 Subject: [PATCH] simplify filename-related code (Thanks to Nobuyoshi Nakada for the hint!) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/downloader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/downloader.rb b/tool/downloader.rb index 1d1df2244c..9c72856484 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -84,7 +84,7 @@ class Downloader index_file = super(UNICODE_PUBLIC+name_dir_part, "#{name_dir_part}index.html", dir, true, index_options) INDEX[:index] = IO.read index_file end - file_base = name.sub(/^.*\//, '').sub(/\.txt$/, '') + file_base = File.basename(name, '.txt') beta_name = INDEX[:index].match(/#{file_base}(-[0-9.]+d\d+)?\.txt/)[0] # make sure we always check for new versions of files, # because they can easily change in the beta period