mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
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:
parent
17aeff3e77
commit
c20aae965e
6 changed files with 13 additions and 25 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue