summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/benchmark.rb2
-rw-r--r--lib/irb/cmd/fork.rb2
-rw-r--r--lib/mkmf.rb2
-rw-r--r--lib/net/ftp.rb8
-rw-r--r--lib/net/smtp.rb2
-rw-r--r--lib/open3.rb8
-rw-r--r--lib/pstore.rb2
-rw-r--r--lib/rexml/element.rb6
-rw-r--r--lib/rexml/light/node.rb2
-rw-r--r--lib/rinda/tuplespace.rb2
-rw-r--r--lib/rss/maker/base.rb8
-rw-r--r--lib/rss/maker/entry.rb4
-rw-r--r--lib/scanf.rb2
-rwxr-xr-xlib/set.rb4
-rw-r--r--lib/shell.rb2
-rw-r--r--lib/shell/command-processor.rb4
-rw-r--r--lib/shell/process-controller.rb2
-rw-r--r--lib/shell/system-command.rb2
-rw-r--r--lib/uri/common.rb2
19 files changed, 33 insertions, 33 deletions
diff --git a/lib/benchmark.rb b/lib/benchmark.rb
index 6a00da1..7fd3d06 100644
--- a/lib/benchmark.rb
+++ b/lib/benchmark.rb
@@ -243,7 +243,7 @@ module Benchmark
# #bmbm yields a Benchmark::Job object and returns an array of
# Benchmark::Tms objects.
#
- def bmbm(width = 0, &blk) # :yield: job
+ def bmbm(width = 0) # :yield: job
job = Job.new(width)
yield(job)
width = job.width + 1
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb
index c266462..a3531d4 100644
--- a/lib/irb/cmd/fork.rb
+++ b/lib/irb/cmd/fork.rb
@@ -15,7 +15,7 @@
module IRB
module ExtendCommand
class Fork<Nop
- def execute(&block)
+ def execute
pid = send ExtendCommand.irb_original_method_name("fork")
unless pid
class << self
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index c25a2dc..4ac6d94 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1125,7 +1125,7 @@ def typedef_expr(type, headers)
return "rbcv_typedef_", member, prelude
end
-def try_signedness(type, member, headers = nil, opts = nil, &b)
+def try_signedness(type, member, headers = nil, opts = nil)
raise ArgumentError, "don't know how to tell signedness of members" if member
if try_static_assert("(#{type})-1 < 0", headers, opts)
return -1
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 149fc6a..9abfbae 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -493,7 +493,7 @@ module Net
# +file+ to the server. If the optional block is given, it also passes it
# the data, in chunks of +blocksize+ characters.
#
- def storbinary(cmd, file, blocksize, rest_offset = nil, &block) # :yield: data
+ def storbinary(cmd, file, blocksize, rest_offset = nil) # :yield: data
if rest_offset
file.seek(rest_offset, IO::SEEK_SET)
end
@@ -504,7 +504,7 @@ module Net
buf = file.read(blocksize)
break if buf == nil
conn.write(buf)
- yield(buf) if block
+ yield(buf) if block_given?
end
conn.close
voidresp
@@ -525,7 +525,7 @@ module Net
# named +file+ to the server, one line at a time. If the optional block is
# given, it also passes it the lines.
#
- def storlines(cmd, file, &block) # :yield: line
+ def storlines(cmd, file) # :yield: line
synchronize do
with_binary(false) do
conn = transfercmd(cmd)
@@ -536,7 +536,7 @@ module Net
buf = buf.chomp + CRLF
end
conn.write(buf)
- yield(buf) if block
+ yield(buf) if block_given?
end
conn.close
voidresp
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 33b88f5..eaa0101 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -933,7 +933,7 @@ module Net
Response.parse(buf)
end
- def critical(&block)
+ def critical
return '200 dummy reply code' if @error_occured
begin
return yield()
diff --git a/lib/open3.rb b/lib/open3.rb
index 01ccbc4..27185f4 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -266,7 +266,7 @@ module Open3
# STDOUT.binmode; print thumnail
# end
#
- def capture3(*cmd, &block)
+ def capture3(*cmd)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -320,7 +320,7 @@ module Open3
# End
# image, s = Open3.capture2("gnuplot", :stdin_data=>gnuplot_commands, :binmode=>true)
#
- def capture2(*cmd, &block)
+ def capture2(*cmd)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -359,7 +359,7 @@ module Open3
# # capture make log
# make_log, s = Open3.capture2e("make")
#
- def capture2e(*cmd, &block)
+ def capture2e(*cmd)
if Hash === cmd.last
opts = cmd.pop.dup
else
@@ -662,7 +662,7 @@ module Open3
end
module_function :pipeline
- def pipeline_run(cmds, pipeline_opts, child_io, parent_io, &block) # :nodoc:
+ def pipeline_run(cmds, pipeline_opts, child_io, parent_io) # :nodoc:
if cmds.empty?
raise ArgumentError, "no commands"
end
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 429d7e5..952445f 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -310,7 +310,7 @@ class PStore
#
# Note that PStore does not support nested transactions.
#
- def transaction(read_only = false, &block) # :yields: pstore
+ def transaction(read_only = false) # :yields: pstore
value = nil
raise PStore::Error, "nested transaction" if !@thread_safe && @lock.locked?
@lock.synchronize do
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb
index 5991859..83e5f6e 100644
--- a/lib/rexml/element.rb
+++ b/lib/rexml/element.rb
@@ -901,11 +901,11 @@ module REXML
# #-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/>
# XPath.each(doc.root, 'child::node()', &block)
# #-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/>
- def each( xpath=nil, &block)
+ def each( xpath=nil )
XPath::each( @element, xpath ) {|e| yield e if e.kind_of? Element }
end
- def collect( xpath=nil, &block )
+ def collect( xpath=nil )
collection = []
XPath::each( @element, xpath ) {|e|
collection << yield(e) if e.kind_of?(Element)
@@ -913,7 +913,7 @@ module REXML
collection
end
- def inject( xpath=nil, initial=nil, &block )
+ def inject( xpath=nil, initial=nil )
first = true
XPath::each( @element, xpath ) {|e|
if (e.kind_of? Element)
diff --git a/lib/rexml/light/node.rb b/lib/rexml/light/node.rb
index 0a896c8..b33f78f 100644
--- a/lib/rexml/light/node.rb
+++ b/lib/rexml/light/node.rb
@@ -40,7 +40,7 @@ module REXML
end
end
- def each( &block )
+ def each
size.times { |x| yield( at(x+4) ) }
end
diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb
index 113aa0d..ba494aa 100644
--- a/lib/rinda/tuplespace.rb
+++ b/lib/rinda/tuplespace.rb
@@ -305,7 +305,7 @@ module Rinda
@bin.delete_at(idx) if idx
end
- def find(&blk)
+ def find
@bin.reverse_each do |x|
return x if yield(x)
end
diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb
index fa2b02d..a776f47 100644
--- a/lib/rss/maker/base.rb
+++ b/lib/rss/maker/base.rb
@@ -353,7 +353,7 @@ module RSS
module SetupDefaultDate
private
- def _set_default_values(&block)
+ def _set_default_values
keep = {
:date => date,
:dc_dates => dc_dates.to_a.dup,
@@ -365,7 +365,7 @@ module RSS
dc_dates.unshift(dc_date)
end
self.date ||= self.dc_date
- super(&block)
+ super
ensure
date = keep[:date]
dc_dates.replace(keep[:dc_dates])
@@ -379,7 +379,7 @@ module RSS
module SetupDefaultLanguage
private
- def _set_default_values(&block)
+ def _set_default_values
keep = {
:dc_languages => dc_languages.to_a.dup,
}
@@ -390,7 +390,7 @@ module RSS
dc_language.value = _language.dup
dc_languages.unshift(dc_language)
end
- super(&block)
+ super
ensure
dc_languages.replace(keep[:dc_languages])
end
diff --git a/lib/rss/maker/entry.rb b/lib/rss/maker/entry.rb
index b35936b..f8f5469 100644
--- a/lib/rss/maker/entry.rb
+++ b/lib/rss/maker/entry.rb
@@ -99,7 +99,7 @@ module RSS
end
end
- def _set_default_values(&block)
+ def _set_default_values
keep = {
:authors => authors.to_a.dup,
:contributors => contributors.to_a.dup,
@@ -126,7 +126,7 @@ module RSS
@maker.channel.title {|t| @title = t}
end
self.updated ||= @maker.channel.updated
- super(&block)
+ super
ensure
authors.replace(keep[:authors])
contributors.replace(keep[:contributors])
diff --git a/lib/scanf.rb b/lib/scanf.rb
index 6d67627..cd1596b 100644
--- a/lib/scanf.rb
+++ b/lib/scanf.rb
@@ -745,7 +745,7 @@ class String
# See Scanf for details on creating a format string.
#
# You will need to require 'scanf' to use String#block_scanf
- def block_scanf(fstr,&b) #:yield: current_match
+ def block_scanf(fstr) #:yield: current_match
fs = Scanf::FormatString.new(fstr)
str = self.dup
final = []
diff --git a/lib/set.rb b/lib/set.rb
index 43edc75..8830342 100755
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -531,7 +531,7 @@ class SortedSet < Set
require 'rbtree'
module_eval %{
- def initialize(*args, &block)
+ def initialize(*args)
@hash = RBTree.new
super
end
@@ -544,7 +544,7 @@ class SortedSet < Set
}
rescue LoadError
module_eval %{
- def initialize(*args, &block)
+ def initialize(*args)
@keys = nil
super
end
diff --git a/lib/shell.rb b/lib/shell.rb
index 522f60a..3b6ebcc 100644
--- a/lib/shell.rb
+++ b/lib/shell.rb
@@ -286,7 +286,7 @@ class Shell
end
end
- def self.notify(*opts, &block)
+ def self.notify(*opts)
Shell::debug_output_synchronize do
if opts[-1].kind_of?(String)
yorn = verbose?
diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb
index ae157eb..da7fecf 100644
--- a/lib/shell/command-processor.rb
+++ b/lib/shell/command-processor.rb
@@ -335,7 +335,7 @@ class Shell
end
# %pwd, %cwd -> @pwd
- def notify(*opts, &block)
+ def notify(*opts)
Shell.notify(*opts) {|mes|
yield mes if iterator?
@@ -407,7 +407,7 @@ class Shell
def self.alias_map
@alias_map
end
- def self.alias_command(ali, command, *opts, &block)
+ def self.alias_command(ali, command, *opts)
ali = ali.id2name if ali.kind_of?(Symbol)
command = command.id2name if command.kind_of?(Symbol)
begin
diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb
index 30f2229..b973539 100644
--- a/lib/shell/process-controller.rb
+++ b/lib/shell/process-controller.rb
@@ -234,7 +234,7 @@ class Shell
end
# simple fork
- def sfork(command, &block)
+ def sfork(command)
pipe_me_in, pipe_peer_out = IO.pipe
pipe_peer_in, pipe_me_out = IO.pipe
diff --git a/lib/shell/system-command.rb b/lib/shell/system-command.rb
index 50d994b..1a8bb1a 100644
--- a/lib/shell/system-command.rb
+++ b/lib/shell/system-command.rb
@@ -145,7 +145,7 @@ class Shell
# then
# mes: "job(%id) close pipe-out."
# yorn: Boolean(@shell.debug? or @shell.verbose?)
- def notify(*opts, &block)
+ def notify(*opts)
@shell.notify(*opts) do |mes|
yield mes if iterator?
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 38b0eb5..2b0dc2f 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -258,7 +258,7 @@ module URI
#
# see also URI::Parser.make_regexp
#
- def extract(str, schemes = nil, &block)
+ def extract(str, schemes = nil)
if block_given?
str.scan(make_regexp(schemes)) { yield $& }
nil