Class: URI::SCP

Class | URI::SCP
In: | lib/uri/open-scp.rb lib/uri/scp.rb lib/uri/open-scp.rb lib/uri/scp.rb
Parent: | Object

### Methods

buffer_open buffer_open new new new2 new2

### Included Modules

OpenURI::OpenRead OpenURI::OpenRead

### Constants

DEFAULT_PORT | = | 22
COMPONENT | = | [ :scheme, :userinfo, :host, :port, :path, :query
DEFAULT_PORT | = | 22
COMPONENT | = | [ :scheme, :userinfo, :host, :port, :path, :query

### Attributes

options | [R] |
options | [R] |

### Public Class methods

new(*args)

[Source]

        # File lib/uri/scp.rb, line 20
    20:     def initialize(*args)
    21:       super(*args)
    22:
    23:       @options = Hash.new
    24:       (query || "").split(/&/).each do |pair|
    25:         name, value = pair.split(/=/, 2)
    26:         opt_name = name.to_sym
    27:         values = value.split(/,/).map { |v| v.to_i.to_s == v ? v.to_i : v }
    28:         values = values.first if values.length == 1
    29:         options[opt_name] = values
    30:       end
    31:     end

new(*args)

[Source]

        # File lib/uri/scp.rb, line 20
    20:     def initialize(*args)
    21:       super(*args)
    22:
    23:       @options = Hash.new
    24:       (query || "").split(/&/).each do |pair|
    25:         name, value = pair.split(/=/, 2)
    26:         opt_name = name.to_sym
    27:         values = value.split(/,/).map { |v| v.to_i.to_s == v ? v.to_i : v }
    28:         values = values.first if values.length == 1
    29:         options[opt_name] = values
    30:       end
    31:     end

new2(user, password, host, port, path, query)

[Source]

        # File lib/uri/scp.rb, line 16
    16:     def self.new2(user, password, host, port, path, query)
    17:       new('scp', [user, password], host, port, nil, path, nil, query)
    18:     end

new2(user, password, host, port, path, query)

[Source]

        # File lib/uri/scp.rb, line 16
    16:     def self.new2(user, password, host, port, path, query)
    17:       new('scp', [user, password], host, port, nil, path, nil, query)
    18:     end

### Public Instance methods

buffer_open(buf, proxy, open_options)

[Source]

        # File lib/uri/open-scp.rb, line 8
     8:     def buffer_open(buf, proxy, open_options)
     9:       options = open_options.merge(:port => port, :password => password)
    10:       progress = options.delete(:progress_proc)
    11:       buf << Net::SCP.download!(host, user, path, nil, open_options, &progress)
    12:       buf.io.rewind
    13:     end

buffer_open(buf, proxy, open_options)

[Source]

        # File lib/uri/open-scp.rb, line 8
     8:     def buffer_open(buf, proxy, open_options)
     9:       options = open_options.merge(:port => port, :password => password)
    10:       progress = options.delete(:progress_proc)
    11:       buf << Net::SCP.download!(host, user, path, nil, open_options, &progress)
    12:       buf.io.rewind
    13:     end

[Validate]