Class: SmartMachine::Grids::Terminal::Wetty
- Inherits:
-
Object
- Object
- SmartMachine::Grids::Terminal::Wetty
- Defined in:
- lib/smart_machine/grids/terminal/wetty.rb
Instance Method Summary collapse
- #downer ⇒ Object
-
#initialize(name:, host:, ssh_host:) ⇒ Wetty
constructor
A new instance of Wetty.
- #uper ⇒ Object
Constructor Details
#initialize(name:, host:, ssh_host:) ⇒ Wetty
Returns a new instance of Wetty.
5 6 7 8 9 |
# File 'lib/smart_machine/grids/terminal/wetty.rb', line 5 def initialize(name:, host:, ssh_host:) @name = name @host = host @ssh_host = ssh_host end |
Instance Method Details
#downer ⇒ Object
18 19 20 21 22 23 |
# File 'lib/smart_machine/grids/terminal/wetty.rb', line 18 def downer raise "Error: Could not stop container: #{@name}" unless system("docker stop '#{@name}'", out: File::NULL) raise "Error: Could not remove container: #{@name}" unless system("docker rm '#{@name}'", out: File::NULL) puts "Stopped & Removed container: #{@name}" end |
#uper ⇒ Object
11 12 13 14 15 16 |
# File 'lib/smart_machine/grids/terminal/wetty.rb', line 11 def uper raise "Error: Could not create container: #{@name}" unless system(command.compact.join(' '), out: File::NULL) raise "Error: Could not start container: #{@name}" unless system("docker start #{@name}", out: File::NULL) puts "Created & Started container: #{@name}" end |