From c20aae965e2e79fcf4c443b266f7012157d5b23b Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 18 Jan 2019 09:52:50 +0000 Subject: Prefer block_given? to iterator? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/shell.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/shell.rb') diff --git a/lib/shell.rb b/lib/shell.rb index 77b3b97ed3..095889626a 100644 --- a/lib/shell.rb +++ b/lib/shell.rb @@ -263,7 +263,7 @@ class Shell def chdir(path = nil, verbose = @verbose) check_point - if iterator? + if block_given? notify("chdir(with block) #{path}") if verbose cwd_old = @cwd begin @@ -297,7 +297,7 @@ class Shell def pushdir(path = nil, verbose = @verbose) check_point - if iterator? + if block_given? notify("pushdir(with block) #{path}") if verbose pushdir(path, nil) begin @@ -446,7 +446,7 @@ class Shell _head = true STDERR.print opts.collect{|mes| mes = mes.dup - yield mes if iterator? + yield mes if block_given? if _head _head = false prefix + mes -- cgit v1.2.3