From 1a0c3d8dd64eb90f5d74e68458d686c4f9cc1669 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 29 May 2019 15:04:31 +0900 Subject: [PATCH] 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 --- tool/vcs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/vcs.rb b/tool/vcs.rb index ecb313d58d..808b28344e 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -407,7 +407,7 @@ class VCS 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