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

ruby-changes:23910

From: nobu <ko1@a...>
Date: Fri, 8 Jun 2012 16:19:50 +0900 (JST)
Subject: [ruby-changes:23910] nobu:r35961 (trunk): test: realpath

nobu	2012-06-08 16:19:38 +0900 (Fri, 08 Jun 2012)

  New Revision: 35961

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

  Log:
    test: realpath
    
    * test/runner.rb (src_testdir): expand real path so that
      TestGem#test_self_find_files does not fail by aliased load path when
      srcdir contains a symbolic link.
    * tool/runruby.rb (srcdir): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/test/runner.rb
    trunk/tool/runruby.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35960)
+++ ChangeLog	(revision 35961)
@@ -1,3 +1,11 @@
+Fri Jun  8 16:19:33 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/runner.rb (src_testdir): expand real path so that
+	  TestGem#test_self_find_files does not fail by aliased load path when
+	  srcdir contains a symbolic link.
+
+	* tool/runruby.rb (srcdir): ditto.
+
 Fri Jun  8 12:04:39 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* process.c (rb_fork_err): error state in the child process is prior
Index: tool/runruby.rb
===================================================================
--- tool/runruby.rb	(revision 35960)
+++ tool/runruby.rb	(revision 35961)
@@ -32,7 +32,16 @@
   ARGV.shift
 end
 
-srcdir ||= File.expand_path('..', File.dirname(__FILE__))
+unless defined?(File.realpath)
+  def File.realpath(*args)
+    Dir.chdir do
+      expand_path(*args)
+      Dir.pwd
+    end
+  end
+end
+
+srcdir ||= File.realpath('..', File.dirname(__FILE__))
 archdir ||= '.'
 
 abs_archdir = File.expand_path(archdir)
@@ -50,7 +59,7 @@
 libs = [abs_archdir]
 extout ||= config["EXTOUT"]
 if extout
-  abs_extout = File.expand_path(extout)
+  abs_extout = File.expand_path(extout, abs_archdir)
   libs << File.expand_path("common", abs_extout) << File.expand_path(config['arch'], abs_extout)
 end
 libs << File.expand_path("lib", srcdir)
Index: test/runner.rb
===================================================================
--- test/runner.rb	(revision 35960)
+++ test/runner.rb	(revision 35961)
@@ -2,7 +2,7 @@
 
 require 'test/unit'
 
-src_testdir = File.dirname(File.expand_path(__FILE__))
+src_testdir = File.dirname(File.realpath(__FILE__))
 $LOAD_PATH << src_testdir
 module Gem
 end

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

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