summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-03 04:59:24 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-03 04:59:24 +0000
commit9620b20227a60b30ed405f7fd3299f7567fc61ad (patch)
treeac04b386f78441fb1b7ff6bee0e582e51420ab0c
parentf930648ae55e14e268197c6e0e2626d231c4038a (diff)
* lib/net/ftp.rb (getbinaryfile): the second argument (localfile)
is now optional. * lib/net/ftp.rb (gettextfile): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/net/ftp.rb4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index aa31131c75..48fa03a027 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Jul 3 13:57:53 2002 Sean Chittenden <sean@ruby-lang.org>
+
+ * lib/net/ftp.rb (getbinaryfile): the second argument (localfile)
+ is now optional.
+
+ * lib/net/ftp.rb (gettextfile): ditto.
+
Wed Jul 3 13:45:42 2002 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb: use &block and yield for speed.
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index ff915fcd2a..da380fcdb4 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -327,7 +327,7 @@ module Net
end
end
- def getbinaryfile(remotefile, localfile,
+ def getbinaryfile(remotefile, localfile = File.basename(remotefile),
blocksize = DEFAULT_BLOCKSIZE, &block)
if @resume
rest_offset = File.size?(localfile)
@@ -347,7 +347,7 @@ module Net
end
end
- def gettextfile(remotefile, localfile, &block)
+ def gettextfile(remotefile, localfile = File.basename(remotefile), &block)
f = open(localfile, "w")
begin
retrlines("RETR " + remotefile) do |line|