Sha256: 37969a6d3150264a40beea000bda40a08f401e7ceadad4e6131046008c03ab57

Contents?: true

Size: 755 Bytes

Versions: 160

Compression:

Stored size: 755 Bytes

Contents

require 'uri/generic'

module URI
  class SCP < Generic
    DEFAULT_PORT = 22

    COMPONENT = [
      :scheme,
      :userinfo,
      :host, :port, :path,
      :query  
    ].freeze

    attr_reader :options

    def self.new2(user, password, host, port, path, query)
      new('scp', [user, password], host, port, nil, path, nil, query)
    end

    def initialize(*args)
      super(*args)

      @options = Hash.new
      (query || "").split(/&/).each do |pair|
        name, value = pair.split(/=/, 2)
        opt_name = name.to_sym
        values = value.split(/,/).map { |v| v.to_i.to_s == v ? v.to_i : v }
        values = values.first if values.length == 1
        options[opt_name] = values
      end
    end
  end

  @@schemes['SCP'] = SCP
end

Version data entries

160 entries across 112 versions & 16 rubygems

Version Path
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/gems/net-scp-1.2.1/lib/uri/scp.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/net-scp-1.2.1/lib/uri/scp.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/gems/net-scp-1.2.1/lib/uri/scp.rb
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/gems/net-scp-1.2.1/lib/uri/scp.rb
vagrant-unbundled-1.9.7.1 vendor/bundle/ruby/2.4.0/gems/net-scp-1.2.1/lib/uri/scp.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-1.0.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-1.0.4 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-1.0.1 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-1.0.1 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.91 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.91 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.9 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.9 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.6 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.6 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.5 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.5 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb
savant-echo-0.1.4 bin/packaging/vendor/ruby/2.2.0/gems/net-scp-1.2.1/lib/uri/scp.rb