ruby-changes:51871
From: duerst <ko1@a...>
Date: Sat, 28 Jul 2018 17:57:05 +0900 (JST)
Subject: [ruby-changes:51871] duerst:r64085 (trunk): update unicode data files directory for normalization tests
duerst 2018-07-28 17:56:59 +0900 (Sat, 28 Jul 2018) New Revision: 64085 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64085 Log: update unicode data files directory for normalization tests * test/test_unicode_normalize.rb: search ucd directory first if it exists. This change follows r61415. Modified files: trunk/test/test_unicode_normalize.rb Index: test/test_unicode_normalize.rb =================================================================== --- test/test_unicode_normalize.rb (revision 64084) +++ test/test_unicode_normalize.rb (revision 64085) @@ -9,10 +9,11 @@ require 'unicode_normalize/normalize' https://github.com/ruby/ruby/blob/trunk/test/test_unicode_normalize.rb#L9 class TestUnicodeNormalize < Test::Unit::TestCase UNICODE_VERSION = RbConfig::CONFIG['UNICODE_VERSION'] - UNICODE_DATA_PATH = "../enc/unicode/data/#{UNICODE_VERSION}" + path = File.expand_path("../enc/unicode/data/#{UNICODE_VERSION}", __dir__) + UNICODE_DATA_PATH = File.directory?("#{path}/ucd") ? "#{path}/ucd" : path def self.expand_filename(basename) - File.expand_path("#{UNICODE_DATA_PATH}/#{basename}.txt", __dir__) + File.expand_path("#{basename}.txt", UNICODE_DATA_PATH) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/