diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-17 07:35:29 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-17 07:35:29 +0000 |
commit | ffbcf9f842d228e4a95b13f415dfc4e141e8f4f0 (patch) | |
tree | 96895c4986a90d822a7aa27833d4fb305db6cf37 /tool | |
parent | c576f14039c920e40e6849657e6dd87772f6f7da (diff) | |
download | ruby-ffbcf9f842d228e4a95b13f415dfc4e141e8f4f0.tar.gz |
downloader.rb: enable cache files
* tool/downloader.rb (Downloader::Unicode.download): enable cache
files when index.html has not been modified since the previous
download, even if beta version.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r-- | tool/downloader.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tool/downloader.rb b/tool/downloader.rb index 5c1bcc35fd..d46ffa671a 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -81,15 +81,17 @@ class Downloader if INDEX.size == 0 index_options = options.dup index_options[:cache_save] = false # TODO: make sure caching really doesn't work for index file + index_data = File.read(under(dir, "index.html")) rescue nil index_file = super(UNICODE_PUBLIC+name_dir_part, "#{name_dir_part}index.html", dir, true, index_options) INDEX[:index] = File.read(index_file) + since = true unless INDEX[:index] == index_data end file_base = File.basename(name, '.txt') return if file_base == '.' # Use pre-generated headers and tables beta_name = INDEX[:index][/#{Regexp.quote(file_base)}(-[0-9.]+d\d+)?\.txt/] # make sure we always check for new versions of files, # because they can easily change in the beta period - super(UNICODE_PUBLIC+name_dir_part+beta_name, name, dir, true, options) + super(UNICODE_PUBLIC+name_dir_part+beta_name, name, dir, since, options) else index_file = Pathname.new(under(dir, name_dir_part+'index.html')) if index_file.exist? |