1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/net/ftp.rb (initialize): set @sock to a NullSocket instance to

raise FTPConnectionError when not connected.   [ruby-dev:40258]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2010-02-06 15:26:20 +00:00
parent e432a4c423
commit 0381cec507
2 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sat Feb 6 23:37:11 2010 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (initialize): set @sock to a NullSocket instance to
raise FTPConnectionError when not connected. [ruby-dev:40258]
Sat Feb 6 23:25:57 2010 Shugo Maeda <shugo@ruby-lang.org>
* ext/curses/view2.rb: replaced with Hugh Sasse's version.

View file

@ -25,6 +25,7 @@ module Net
class FTPTempError < FTPError; end
class FTPPermError < FTPError; end
class FTPProtoError < FTPError; end
class FTPConnectionError < FTPError; end
# :startdoc:
#
@ -132,7 +133,7 @@ module Net
@passive = false
@debug_mode = false
@resume = false
@sock = nil
@sock = NullSocket.new
@logged_in = false
if host
connect(host)
@ -966,8 +967,15 @@ module Net
return dirname
end
private :parse257
end
# :stopdoc:
class NullSocket
def method_missing(mid, *args)
raise FTPConnectionError, "not connected"
end
end
# :startdoc:
end
end