Class: RIO::FTP::RL

Inherits:
RL::URIBase show all
Defined in:
lib/rio/scheme/ftp.rb

Constant Summary

Constants inherited from RL::URIBase

RL::URIBase::HOST, RL::URIBase::SCHEME

Constants inherited from RL::WithPath

RL::WithPath::HOST, RL::WithPath::SCHEME

Instance Attribute Summary

Attributes inherited from RL::URIBase

#uri

Attributes inherited from RL::Base

#fs

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RL::URIBase

#_get_base_from_arg, #_get_opts_from_args, #absolute?, #arg0_info_, #base, #base=, #host, #host=, #init_from_args_, #initialize_copy, #opaque, #path, #path=, #pathroot, #scheme, #to_s, #url, #urlpath, #urlpath=, #urlroot

Methods inherited from RL::WithPath

#_build, #_parts, #_uri, #abs, #base, #basename, #build_arg0_, #dirname, #filename, #fspath, #fspath=, #fspath_no_slash, #host, #host=, #is_root?, #merge, #opaque, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #route_from, #route_to, #scheme, #split, #uri, #uri_from_string_, #urlpath, #urlpath=

Methods included from Error::NotImplemented

#nodef

Methods inherited from RL::Base

#==, #===, #=~, #callstr, #close, #escape, #fs2url, #fspath, #initialize_copy, is_riorl?, #length, parse, #path, #rl, split_riorl, subscheme, #to_rl, #to_s, #unescape, #url, #url2fs

Constructor Details

#initialize(arg0, *args) ⇒ RL

Returns a new instance of RL.



52
53
54
55
56
57
# File 'lib/rio/scheme/ftp.rb', line 52

def initialize(arg0,*args)
  #p callstr('initialize',arg0,*args)
  super(*_sup_args(arg0,*args))
  @ftype = nil
  @names = nil
end

Class Method Details

.splitrl(s) ⇒ Object



98
99
100
101
102
103
# File 'lib/rio/scheme/ftp.rb', line 98

def self.splitrl(s)
  #p "splitrl(#{s})"
  sub,opq,whole = split_riorl(s)
  #p sub,opq,whole
  [whole] 
end

Instance Method Details

#_sup_args(arg0, *args) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/rio/scheme/ftp.rb', line 58

def _sup_args(arg0,*args)
  if arg0 == 'ftp:'
    hn = args.shift || 'localhost'
    us = args.shift 
    pw = args.shift
    pt = args.shift || ''
    ph = args.shift || '/'
    tc = args.shift || ''
    u = URI::FTP.new2(us,pw,hn,pt,ph,tc)
    return [u]
  else
    return [arg0] + args
  end
end

#dir_rlObject



114
115
116
# File 'lib/rio/scheme/ftp.rb', line 114

def dir_rl() 
  self 
end

#file_rlObject



111
112
113
# File 'lib/rio/scheme/ftp.rb', line 111

def file_rl() 
  RIO::FTP::Stream::RL.new(self.uri) 
end

#join(*args) ⇒ Object

end



92
93
94
95
# File 'lib/rio/scheme/ftp.rb', line 92

def join(*args)
  return self if args.empty?
  join_(args.map{ |arg| RIO::RL.fs2url(arg.to_s)})
end

#open(*args) ⇒ Object



108
109
110
# File 'lib/rio/scheme/ftp.rb', line 108

def open(*args)
  IOH::Dir.new(RIO::FTP::Dir::Stream.new(self.uri))
end

#openfs_Object



104
105
106
107
# File 'lib/rio/scheme/ftp.rb', line 104

def openfs_
  #p callstr('openfs_')
  RIO::FTP::FS.create(self.uri)
end