diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-06 11:41:12 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-06 11:41:12 +0000 |
commit | d9699fadf8b7031fb92854106d7703b8370eb95f (patch) | |
tree | 76d734cd7204d3d6ba2a351a38048b0c777bade7 /tool | |
parent | b991ccc2103eb468cc663a1263750fb86d0745ae (diff) | |
download | ruby-d9699fadf8b7031fb92854106d7703b8370eb95f.tar.gz |
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
Diffstat (limited to 'tool')
-rw-r--r-- | tool/downloader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |