[前][次][番号順一覧][スレッド一覧]

ruby-changes:55386

From: nobu <ko1@a...>
Date: Wed, 17 Apr 2019 16:35:35 +0900 (JST)
Subject: [ruby-changes:55386] nobu:r67594 (trunk): downloader.rb: enable cache files

nobu	2019-04-17 16:35:29 +0900 (Wed, 17 Apr 2019)

  New Revision: 67594

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67594

  Log:
    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.

  Modified files:
    trunk/tool/downloader.rb
Index: tool/downloader.rb
===================================================================
--- tool/downloader.rb	(revision 67593)
+++ tool/downloader.rb	(revision 67594)
@@ -81,15 +81,17 @@ class Downloader https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L81
         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?

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]