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

ruby-changes:12682

From: nobu <ko1@a...>
Date: Wed, 5 Aug 2009 03:29:07 +0900 (JST)
Subject: [ruby-changes:12682] Ruby:r24397 (trunk): * lib/test/unit.rb (Test::Unit.setup_argv): expands paths before

nobu	2009-08-05 03:28:49 +0900 (Wed, 05 Aug 2009)

  New Revision: 24397

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

  Log:
    * lib/test/unit.rb (Test::Unit.setup_argv): expands paths before
      requiring.  [ruby-dev:39012]

  Modified files:
    trunk/ChangeLog
    trunk/lib/test/unit.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24396)
+++ ChangeLog	(revision 24397)
@@ -1,3 +1,8 @@
+Wed Aug  5 03:28:41 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/test/unit.rb (Test::Unit.setup_argv): expands paths before
+	  requiring.  [ruby-dev:39012]
+
 Wed Aug  5 01:38:27 2009  Yusuke Endoh  <mame@t...>
  
 	* lib/pp.rb (guard_inspect_key): untrust internal hash to prevent
Index: lib/test/unit.rb
===================================================================
--- lib/test/unit.rb	(revision 24396)
+++ lib/test/unit.rb	(revision 24397)
@@ -32,7 +32,7 @@
       end
 
       files.map! {|f|
-        f = f.gsub(Regexp.compile(Regexp.quote(File::ALT_SEPARATOR)), File::SEPARATOR) if File::ALT_SEPARATOR
+        f = f.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
         if File.directory? f
           Dir["#{f}/**/test_*.rb"]
         elsif File.file? f
@@ -47,12 +47,12 @@
       files.reject! {|f| reject_pat =~ f }
 
       files.each {|f|
-        d = File.dirname(File.expand_path(f))
+        d = File.dirname(path = File.expand_path(f))
         unless $:.include? d
           $: << d
         end
         begin
-          require f
+          require path
         rescue LoadError
           puts "#{f}: #{$!}"
         end

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

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