to_s

to_s() Instance Public methods

path

path() Instance Public methods Returns the path from an FTP URI. RFC 1738 specifically states that the path for an FTP URI does not include the / which separates the URI path from the URI host. Example: ftp://ftp.example.com/pub/ruby The above URI indicates that the client should connect to ftp.example.com then cd pub/ruby from the initial login directory. If you want to cd to an absolute directory, you must include an escaped / (%2F) in the path. Example: ftp://ftp.example.com/%2

new

new(*arg) Class Public methods Description Creates a new URI::FTP object from generic URL components with no syntax checking. Unlike build(), this method does not escape the path component as required by RFC1738; instead it is treated as per RFC2396. Arguments are scheme, userinfo, host, port, registry, path, opaque, query and fragment, in that order.

build

build(args) Class Public methods Description Creates a new URI::FTP object from components, with syntax checking. The components accepted are userinfo, host, port, path and typecode. The components should be provided either as an Array, or as a Hash with keys formed by preceding the component names with a colon. If an Array is used, the components must be passed in the order userinfo, host, port, path, typecode If the path supplied is absolute, it will be escaped in order to make

unescape

unescape(*arg) Instance Public methods Synopsis URI.unescape(str) Args str Unescapes the string. Usage require 'uri' enc_uri = URI.escape("http://example.com/?a=\11\15") p enc_uri # => "http://example.com/?a=%09%0D" p URI.unescape(enc_uri) # => "http://example.com/?a=\t\r" decode

escape

escape(*arg) Instance Public methods Synopsis URI.escape(str [, unsafe]) Args str String to replaces in. unsafe Regexp that matches all symbols that must be replaced with codes. By default uses REGEXP::UNSAFE. When this argument is a String, it represents a character set. Description Escapes the string, replacing all unsafe characters with codes. Usage require 'uri' enc_uri = URI.escape("http://example.com/?a=\11\15") p enc_uri # => "http://example.com/?a=%09%0D" p U

encode

encode(*arg) Instance Public methods Alias for: escape

decode

decode(*arg) Instance Public methods Alias for: unescape

send_io

unixsocket.send_io(io) => nil Instance Public methods Sends io as file descriptor passing. s1, s2 = UNIXSocket.pair s1.send_io STDOUT stdout = s2.recv_io p STDOUT.fileno #=> 1 p stdout.fileno #=> 6 stdout.puts "hello" # outputs "hello\n" to standard output.

recvfrom

unixsocket.recvfrom(maxlen [, flags]) => [mesg, unixaddress] Instance Public methods Receives a message via unixsocket. maxlen is the maximum number of bytes to receive. flags should be a bitwise OR of Socket::MSG_* constants. s1 = Socket.new(:UNIX, :DGRAM, 0) s1_ai = Addrinfo.unix("/tmp/sock1") s1.bind(s1_ai) s2 = Socket.new(:UNIX, :DGRAM, 0) s2_ai = Addrinfo.unix("/tmp/sock2") s2.bind(s2_ai) s3 = UNIXSocket.for_fd(s2.fileno) s1.send "a", 0, s2_ai p s3.recvfrom(10) #=> ["