Class: SSHKit::Host
- Inherits:
-
Object
- Object
- SSHKit::Host
- Defined in:
- lib/sshkit/docker_host_ext.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#docker_options ⇒ Object
10 11 12 |
# File 'lib/sshkit/docker_host_ext.rb', line 10 def ||= {} end |
Instance Method Details
#docker=(hash) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sshkit/docker_host_ext.rb', line 14 def docker=(hash) @hostname = "(docker " @user ||= 'root' .update hash.symbolize_keys if .has_key?(:image) @hostname << "image: #{@docker_options[:image]})" elsif .has_key?(:container) @hostname << "container: #{@docker_options[:container]})" else raise ArgumentError, "Please specify image or container for docker! (ex; docker: {image: 'ruby:2.2'})" end end |
#docker? ⇒ Boolean
6 7 8 |
# File 'lib/sshkit/docker_host_ext.rb', line 6 def docker? !.empty? end |