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/command-processor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/shell/command-processor.rb') diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb index 00357e06fd..5fe6056560 100644 --- a/lib/shell/command-processor.rb +++ b/lib/shell/command-processor.rb @@ -343,7 +343,7 @@ class Shell # %pwd, %cwd -> @pwd def notify(*opts) Shell.notify(*opts) {|mes| - yield mes if iterator? + yield mes if block_given? mes.gsub!("%pwd", "#{@cwd}") mes.gsub!("%cwd", "#{@cwd}") @@ -437,7 +437,7 @@ class Shell ali = ali.id2name if ali.kind_of?(Symbol) command = command.id2name if command.kind_of?(Symbol) begin - if iterator? + if block_given? @alias_map[ali.intern] = proc eval((d = %Q[def #{ali}(*opts) -- cgit v1.2.3