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

ruby-changes:55903

From: Takashi <ko1@a...>
Date: Wed, 29 May 2019 15:05:20 +0900 (JST)
Subject: [ruby-changes:55903] Takashi Kokubun: 1a0c3d8dd6 (trunk): Convert Enumerator to Array for Ruby 1.9.3

https://git.ruby-lang.org/ruby.git/commit/?id=1a0c3d8dd6

From 1a0c3d8dd64eb90f5d74e68458d686c4f9cc1669 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Wed, 29 May 2019 15:04:31 +0900
Subject: Convert Enumerator to Array for Ruby 1.9.3

String#lines seems to return Enumerator in Ruby 1.9.3, and it does not
respond to #delete_if https://travis-ci.org/ruby/ruby/jobs/538559919

diff --git a/tool/vcs.rb b/tool/vcs.rb
index ecb313d..808b283 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -407,7 +407,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L407
       modified = log[/^Date:\s+(.*)/, 1]
       branch = cmd_read_at(srcdir, [gitcmd + %W[symbolic-ref --short HEAD]])
       if branch.empty?
-        branch_list = cmd_read_at(srcdir, [gitcmd + %W[branch --list --contains HEAD]]).lines
+        branch_list = cmd_read_at(srcdir, [gitcmd + %W[branch --list --contains HEAD]]).lines.to_a
         branch_list.delete_if {|b| /detached at/ =~ b}
         (branch = branch_list[0]).strip! unless branch_list.empty?
       end
-- 
cgit v0.10.2


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

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