Class: Pione::Location::MyFTPScheme
- Inherits:
-
Pione::LocationScheme
- Object
- Pione::LocationScheme
- Pione::Location::MyFTPScheme
- Defined in:
- lib/pione/location/myftp-scheme.rb
Overview
MyFTPScheme is a special scheme for launching PIONE embedded ftp server.
Constant Summary collapse
- PORT =
39123
- COMPONENT =
[:scheme, :user, :password, :host, :port, :path]
Instance Method Summary collapse
-
#normalize ⇒ URI
Normalize the URI.
-
#to_ftp_scheme ⇒ URI
Return ftp scheme that refers the ftp server.
Instance Method Details
#normalize ⇒ URI
Normalize the URI.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/pione/location/myftp-scheme.rb', line 18 def normalize hash = { :scheme => "myftp", :userinfo => userinfo || Util::FTPServer.auth_info.to_userinfo, :host => (host == "myself" or host.nil?) ? Util::IPAddress.myself : host, :port => port || PORT, :path => File.(path, Global.pwd) + (directory? ? "/" : "") } MyFTPScheme.build(hash) end |
#to_ftp_scheme ⇒ URI
Return ftp scheme that refers the ftp server.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pione/location/myftp-scheme.rb', line 33 def to_ftp_scheme hash = { :scheme => "ftp", :userinfo => userinfo || Util::FTPServer.auth_info.to_userinfo, :host => (host == "myself" or host.nil?) ? Util::IPAddress.myself : host, :port => port || PORT, :path => "/" } URI::FTP.build(hash) end |