aboutsummaryrefslogtreecommitdiffstats
path: root/lib/shell.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-18 09:52:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-18 09:52:50 +0000
commitc20aae965e2e79fcf4c443b266f7012157d5b23b (patch)
tree3b1e6cbcd51d732d05bfd3273c0024c8a9658369 /lib/shell.rb
parent17aeff3e77e6fe0d37a9943dd93bcb16c4bb9f66 (diff)
downloadruby-c20aae965e2e79fcf4c443b266f7012157d5b23b.tar.gz
Prefer block_given? to iterator?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/shell.rb')
-rw-r--r--lib/shell.rb6
1 files changed, 3 insertions, 3 deletions
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