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

ruby-changes:47285

From: nagachika <ko1@a...>
Date: Sun, 23 Jul 2017 16:36:14 +0900 (JST)
Subject: [ruby-changes:47285] nagachika:r59400 (ruby_2_4): merge revision(s) 59102: [Backport #13515]

nagachika	2017-07-23 16:36:10 +0900 (Sun, 23 Jul 2017)

  New Revision: 59400

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

  Log:
    merge revision(s) 59102: [Backport #13515]
    
    pathname.rb: UNC root pathname needs a separator
    
    * ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname
      needs a separator.  File.basename returns "/" on UNC root, as
      well as sole drive letter, even if it does not end with a
      separator.  [ruby-core:80900] [Bug #13515]

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/ext/pathname/lib/pathname.rb
    branches/ruby_2_4/test/pathname/test_pathname.rb
    branches/ruby_2_4/version.h
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 59399)
+++ ruby_2_4/version.h	(revision 59400)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.2"
 #define RUBY_RELEASE_DATE "2017-07-23"
-#define RUBY_PATCHLEVEL 151
+#define RUBY_PATCHLEVEL 152
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 7
Index: ruby_2_4/ext/pathname/lib/pathname.rb
===================================================================
--- ruby_2_4/ext/pathname/lib/pathname.rb	(revision 59399)
+++ ruby_2_4/ext/pathname/lib/pathname.rb	(revision 59400)
@@ -378,7 +378,7 @@ class Pathname https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ext/pathname/lib/pathname.rb#L378
       basename_list2.shift
     end
     r1 = chop_basename(prefix1)
-    if !r1 && /#{SEPARATOR_PAT}/o =~ File.basename(prefix1)
+    if !r1 && (r1 = /#{SEPARATOR_PAT}/o =~ File.basename(prefix1))
       while !basename_list2.empty? && basename_list2.first == '..'
         index_list2.shift
         basename_list2.shift
Index: ruby_2_4/test/pathname/test_pathname.rb
===================================================================
--- ruby_2_4/test/pathname/test_pathname.rb	(revision 59399)
+++ ruby_2_4/test/pathname/test_pathname.rb	(revision 59400)
@@ -14,8 +14,8 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/pathname/test_pathname.rb#L14
   end
 
   def self.get_linenum
-    if /:(\d+):/ =~ caller[1]
-      $1.to_i
+    if loc = caller_locations(2, 1)
+      loc[0].lineno
     else
       nil
     end
@@ -221,6 +221,8 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/pathname/test_pathname.rb#L221
 
   defassert(:plus, 'a//b/d//e', 'a//b/c', '../d//e')
 
+  defassert(:plus, '//foo/var/bar', '//foo/var', 'bar')
+
   def test_slash
     assert_kind_of(Pathname, Pathname("a") / Pathname("b"))
   end
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 59399)
+++ ruby_2_4	(revision 59400)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r59102

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

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