Sha256: 1cd7e240ab46aae767b94c547fbf8bb927223e55bc77ecfdc9524413fc75366d

Contents?: true

Size: 564 Bytes

Versions: 5

Compression:

Stored size: 564 Bytes

Contents

require 'taketo/config_visitor'
require 'taketo/printer'

module Taketo
  class SSHConfigGeneratorVisitor < ConfigVisitor
    include Printer

    visit Server do |server|
      put_server(server, server.global_alias) unless server.global_alias.to_s.empty?
      put_server(server, server.host)
    end

    def put_server(server, host)
      put "Host #{host}"
      put "Hostname #{server.host}"
      put_optional "Port", server.port
      put_optional "User", server.username
      put_optional "IdentityFile", server.identity_file
      put
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
taketo-0.2.0.alpha lib/taketo/ssh_config_generator_visitor.rb
taketo-0.1.3 lib/taketo/ssh_config_generator_visitor.rb
taketo-0.1.2 lib/taketo/ssh_config_generator_visitor.rb
taketo-0.1.1 lib/taketo/ssh_config_generator_visitor.rb
taketo-0.1.0 lib/taketo/ssh_config_generator_visitor.rb