mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
f930648ae5
commit
9620b20227
2 changed files with 9 additions and 2 deletions
|
@ -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>
|
Wed Jul 3 13:45:42 2002 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* lib/net/ftp.rb: use &block and yield for speed.
|
* lib/net/ftp.rb: use &block and yield for speed.
|
||||||
|
|
|
@ -327,7 +327,7 @@ module Net
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def getbinaryfile(remotefile, localfile,
|
def getbinaryfile(remotefile, localfile = File.basename(remotefile),
|
||||||
blocksize = DEFAULT_BLOCKSIZE, &block)
|
blocksize = DEFAULT_BLOCKSIZE, &block)
|
||||||
if @resume
|
if @resume
|
||||||
rest_offset = File.size?(localfile)
|
rest_offset = File.size?(localfile)
|
||||||
|
@ -347,7 +347,7 @@ module Net
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def gettextfile(remotefile, localfile, &block)
|
def gettextfile(remotefile, localfile = File.basename(remotefile), &block)
|
||||||
f = open(localfile, "w")
|
f = open(localfile, "w")
|
||||||
begin
|
begin
|
||||||
retrlines("RETR " + remotefile) do |line|
|
retrlines("RETR " + remotefile) do |line|
|
||||||
|
|
Loading…
Add table
Reference in a new issue