summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/ftp.rb8
-rw-r--r--lib/net/smtp.rb2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 149fc6adc1..9abfbae421 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 33b88f5c21..eaa010115f 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()