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

ruby-changes:35729

From: duerst <ko1@a...>
Date: Mon, 6 Oct 2014 10:58:23 +0900 (JST)
Subject: [ruby-changes:35729] duerst:r47811 (trunk): tool/unicode_norm_gen.rb: Adjusted directory paths.

duerst	2014-10-06 10:58:01 +0900 (Mon, 06 Oct 2014)

  New Revision: 47811

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

  Log:
    tool/unicode_norm_gen.rb: Adjusted directory paths.

  Modified files:
    trunk/ChangeLog
    trunk/tool/unicode_norm_gen.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47810)
+++ ChangeLog	(revision 47811)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Oct  6 10:57:57 2014  Martin Duerst <duerst@i...>
+
+	* tool/unicode_norm_gen.rb: Adjusted directory paths.
+
 Mon Oct  6 10:27:27 2014  Martin Duerst <duerst@i...>
 
 	* tool/unicode_norm_gen.rb: Data generation script imported from
Index: tool/unicode_norm_gen.rb
===================================================================
--- tool/unicode_norm_gen.rb	(revision 47810)
+++ tool/unicode_norm_gen.rb	(revision 47811)
@@ -4,6 +4,9 @@ https://github.com/ruby/ruby/blob/trunk/tool/unicode_norm_gen.rb#L4
 # available under the same licence as Ruby itself
 # (see http://www.ruby-lang.org/en/LICENSE.txt)
 
+InputDataDir = '../enc/unicode/data'
+OuputDataDir = '../lib/unicode_normalize'
+
 class Integer
   def to_UTF8()
     if self>0xFFFF
@@ -53,7 +56,7 @@ class Hash https://github.com/ruby/ruby/blob/trunk/tool/unicode_norm_gen.rb#L56
 end
 
 # read the file 'CompositionExclusions.txt'
-composition_exclusions = IO.readlines("../data/CompositionExclusions.txt")
+composition_exclusions = IO.readlines("#{InputDataDir}/CompositionExclusions.txt")
                            .select { |line| line =~ /^[A-Z0-9]{4,5}/ }
                            .collect { |line| line.split(' ').first.hex }
 
@@ -62,7 +65,7 @@ kompatible_table = {} https://github.com/ruby/ruby/blob/trunk/tool/unicode_norm_gen.rb#L65
 CombiningClass = {}  # constant to allow use in Integer#to_UTF8
 
 # read the file 'UnicodeData.txt'
-IO.foreach("../data/UnicodeData.txt") do |line|
+IO.foreach("#{InputDataDir}/UnicodeData.txt") do |line|
   codepoint, name, _2, char_class, _4, decomposition, *_rest = line.split(";")
 
   case decomposition
@@ -129,7 +132,7 @@ class_table_str = CombiningClass.collect https://github.com/ruby/ruby/blob/trunk/tool/unicode_norm_gen.rb#L132
 end.line_slice "\n    "
 
 # generate normalization tables file
-open("normalize_tables.rb", "w").print <<MAPPING_TABLE_FILE_END
+open("#{OuputDataDir}/normalize_tables.rb", "w").print <<MAPPING_TABLE_FILE_END
 # coding: utf-8
 
 # automatically generated by generate.rb

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

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