Class: Loom::HostSpec

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/loom/host_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host_string) ⇒ HostSpec

TODO: change this to take an sshkit_host and make parse public. Stop calling parse from the ctor.



16
17
18
# File 'lib/loom/host_spec.rb', line 16

def initialize(host_string)
  @sshkit_host = parse host_string
end

Instance Attribute Details

#disabledObject

Returns the value of attribute disabled.



11
12
13
# File 'lib/loom/host_spec.rb', line 11

def disabled
  @disabled
end

#sshkit_hostObject (readonly)

Returns the value of attribute sshkit_host.



12
13
14
# File 'lib/loom/host_spec.rb', line 12

def sshkit_host
  @sshkit_host
end

Instance Method Details

#is_localhost?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/loom/host_spec.rb', line 25

def is_localhost?
  hostname == "localhost" && port.nil? && user.nil?
end

#is_remote?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/loom/host_spec.rb', line 21

def is_remote?
  !is_localhost?
end