Sha256: 305c5a9e60750ef556a69a24502f777ffd39ec903b3d7f3537c1779175f3af6b
Contents?: true
Size: 786 Bytes
Versions: 56
Compression:
Stored size: 786 Bytes
Contents
require 'contracts' require 'sshkit' module Cloudstrap module SSH class Client include ::Contracts::Core include ::Contracts::Builtin Contract String => Client def initialize(private_key) # TODO: Eliminate side-effects ::SSHKit::Backend::Netssh.configure do |ssh| ssh.ssh_options = { config: false, auth_methods: ['publickey'], keys: private_key, keys_only: true } end self end Contract String, Proc => Any def to(host, &block) ::SSHKit::Coordinator.new("#{config.ssh_username}@#{host}").each(&block) end private Contract None => Config def config @config ||= Config.new end end end end
Version data entries
56 entries across 56 versions & 1 rubygems