diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/cmd/fork.rb | 2 | ||||
-rw-r--r-- | lib/shell.rb | 6 | ||||
-rw-r--r-- | lib/shell/command-processor.rb | 4 | ||||
-rw-r--r-- | lib/shell/system-command.rb | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb index ae4d51b5d1..31d53dcaba 100644 --- a/lib/irb/cmd/fork.rb +++ b/lib/irb/cmd/fork.rb @@ -21,7 +21,7 @@ module IRB class << self alias_method :exit, ExtendCommand.irb_original_method_name('exit') end - if iterator? + if block_given? begin yield ensure 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 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) diff --git a/lib/shell/system-command.rb b/lib/shell/system-command.rb index 767a9ee12c..9d1b07e98c 100644 --- a/lib/shell/system-command.rb +++ b/lib/shell/system-command.rb @@ -147,7 +147,7 @@ class Shell # yorn: Boolean(@shell.debug? or @shell.verbose?) def notify(*opts) @shell.notify(*opts) do |mes| - yield mes if iterator? + yield mes if block_given? mes.gsub!("%id", "#{@command}:##{@pid}") mes.gsub!("%name", "#{@command}") |