Prefer block_given? to iterator?

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-01-18 09:52:50 +00:00
parent 17aeff3e77
commit c20aae965e
6 changed files with 13 additions and 25 deletions

View file

@ -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)