Class: Shiplane::Host
- Inherits:
-
Object
- Object
- Shiplane::Host
- Extended by:
- Forwardable
- Includes:
- SSHKit::DSL
- Defined in:
- lib/shiplane/host.rb
Constant Summary collapse
- SSHKIT_PROPERTIES =
%i(user password keys hostname port ssh_options)
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#host ⇒ Object
Returns the value of attribute host.
-
#role ⇒ Object
Returns the value of attribute role.
Instance Method Summary collapse
- #capistrano_role ⇒ Object
-
#initialize(role, env) ⇒ Host
constructor
A new instance of Host.
- #requires_sudo? ⇒ Boolean
- #sshkit_values ⇒ Object
Constructor Details
#initialize(role, env) ⇒ Host
Returns a new instance of Host.
15 16 17 18 |
# File 'lib/shiplane/host.rb', line 15 def initialize(role, env) @role = role @env = env end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
9 10 11 |
# File 'lib/shiplane/host.rb', line 9 def env @env end |
#host ⇒ Object
Returns the value of attribute host.
9 10 11 |
# File 'lib/shiplane/host.rb', line 9 def host @host end |
#role ⇒ Object
Returns the value of attribute role.
9 10 11 |
# File 'lib/shiplane/host.rb', line 9 def role @role end |
Instance Method Details
#capistrano_role ⇒ Object
24 25 26 27 28 |
# File 'lib/shiplane/host.rb', line 24 def capistrano_role @capistrano_role ||= role.dup.tap do |r| r.properties.set(:ssh_options, ) end end |
#requires_sudo? ⇒ Boolean
36 37 38 |
# File 'lib/shiplane/host.rb', line 36 def requires_sudo? @requires_sudo ||= config.fetch('requires_sudo', false) end |
#sshkit_values ⇒ Object
30 31 32 33 34 |
# File 'lib/shiplane/host.rb', line 30 def sshkit_values { interaction_handler: { "[sudo] password for #{user}: " => "#{password}\n" } } end |