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

ruby-changes:38876

From: mame <ko1@a...>
Date: Thu, 18 Jun 2015 23:04:07 +0900 (JST)
Subject: [ruby-changes:38876] mame:r50957 (trunk): * enc/make_encmake.rb: added --transes and --no-transes options.

mame	2015-06-18 23:03:51 +0900 (Thu, 18 Jun 2015)

  New Revision: 50957

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

  Log:
    * enc/make_encmake.rb: added --transes and --no-transes options.

  Modified files:
    trunk/ChangeLog
    trunk/enc/make_encmake.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50956)
+++ ChangeLog	(revision 50957)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jun 18 22:50:07 2015  Yusuke Endoh  <mame@r...>
+
+	* enc/make_encmake.rb: added --transes and --no-transes options.
+
 Thu Jun 18 18:24:12 2015  Eric Wong  <e@8...>
 
 	* test/socket/test_unix.rb: replace sleep with select
Index: enc/make_encmake.rb
===================================================================
--- enc/make_encmake.rb	(revision 50956)
+++ enc/make_encmake.rb	(revision 50957)
@@ -15,6 +15,8 @@ BUILTIN_ENCS = [] https://github.com/ruby/ruby/blob/trunk/enc/make_encmake.rb#L15
 BUILTIN_TRANSES = []
 ENC_PATTERNS = []
 NOENC_PATTERNS = []
+TRANS_PATTERNS = []
+NOTRANS_PATTERNS = []
 module_type = :dynamic
 
 until ARGV.empty?
@@ -31,6 +33,12 @@ until ARGV.empty? https://github.com/ruby/ruby/blob/trunk/enc/make_encmake.rb#L33
   when /\A--no-encs=/
     NOENC_PATTERNS.concat $'.split
     ARGV.shift
+  when /\A--transes=/
+    TRANS_PATTERNS.concat $'.split
+    ARGV.shift
+  when /\A--no-transes=/
+    NOTRANS_PATTERNS.concat $'.split
+    ARGV.shift
   when /\A--module$/
     ARGV.shift
   when /\A--modulestatic$/
@@ -91,6 +99,10 @@ def target_transcoders https://github.com/ruby/ruby/blob/trunk/enc/make_encmake.rb#L99
   trans -= BUILTIN_TRANSES
   atrans -= BUILTIN_TRANSES
   trans.uniq!
+  atrans.reject! {|e| !TRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !TRANS_PATTERNS.empty?
+  atrans.reject! {|e| NOTRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
+  trans.reject! {|e| !TRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !TRANS_PATTERNS.empty?
+  trans.reject! {|e| NOTRANS_PATTERNS.any? {|p| File.fnmatch?(p, e)}}
   atrans = atrans.sort_by(&ALPHANUMERIC_ORDER)
   trans = trans.sort_by(&ALPHANUMERIC_ORDER)
   trans.delete(db = "transdb")

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

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