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

ruby-changes:8001

From: ryan <ko1@a...>
Date: Wed, 24 Sep 2008 17:50:27 +0900 (JST)
Subject: [ruby-changes:8001] Ruby:r19525 (trunk): Allow for -v and other flags to be passed through properly

ryan	2008-09-24 17:50:16 +0900 (Wed, 24 Sep 2008)

  New Revision: 19525

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

  Log:
    Allow for -v and other flags to be passed through properly

  Modified files:
    trunk/test/runner.rb

Index: test/runner.rb
===================================================================
--- test/runner.rb	(revision 19524)
+++ test/runner.rb	(revision 19525)
@@ -20,8 +20,11 @@
 test_files = (Dir[File.join(test_dir, "test_*.rb")] +
               Dir[File.join(test_dir, "**/test_*.rb")])
 
-test_files = test_files.grep(Regexp.union(*ARGV)) unless ARGV.empty?
+flags, files = ARGV.partition { |arg| arg =~ /^-/ }
+test_files = test_files.grep(Regexp.union(*files)) unless files.empty?
 
+ARGV.replace flags
+
 test_files.each do |test|
   require test
 end

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

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