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

ruby-changes:52633

From: nobu <ko1@a...>
Date: Wed, 26 Sep 2018 08:31:29 +0900 (JST)
Subject: [ruby-changes:52633] nobu:r64845 (trunk): Expand spec files to realpaths

nobu	2018-09-26 08:31:22 +0900 (Wed, 26 Sep 2018)

  New Revision: 64845

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

  Log:
    Expand spec files to realpaths
    
    * spec/mspec/lib/mspec/utils/script.rb (MSpecScript#entries): expand
      the given spec path to the realpath, not to require a library by
      realpath and symbolic link path from the spec file.
    
      reapply r64749 and r64751 overridden by r64830.

  Modified files:
    trunk/spec/mspec/lib/mspec/utils/script.rb
Index: spec/mspec/lib/mspec/utils/script.rb
===================================================================
--- spec/mspec/lib/mspec/utils/script.rb	(revision 64844)
+++ spec/mspec/lib/mspec/utils/script.rb	(revision 64845)
@@ -189,7 +189,11 @@ class MSpecScript https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/utils/script.rb#L189
     end
 
     patterns.each do |pattern|
-      expanded = File.expand_path(pattern)
+      begin
+        expanded = File.realpath(pattern)
+      rescue Errno::ENOENT
+        next
+      end
       if File.file?(expanded) && expanded.end_with?('.rb')
         return [expanded]
       elsif File.directory?(expanded)

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

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