Class: Nutella::Stop
- Inherits:
-
RunCommand
- Object
- Command
- RunCommand
- Nutella::Stop
- Defined in:
- lib/core/commands/stop.rb
Instance Method Summary collapse
Methods inherited from RunCommand
#extract_names, #for_each_actor_in_dir, #output_success_message
Instance Method Details
#run(args = nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/core/commands/stop.rb', line 8 def run(args=nil) # If the current directory is not a nutella project, return return unless Nutella.current_project.exist? # Extract run (passed run name) and run_id run, run_id = extract_names args # Check that the run_id exists in the list and, if it is not, # return false return unless remove_from_run_list run_id # Stops all the bots Tmux.kill_session run_id # Stop all nutella internal actors, if needed if Nutella.runlist.empty? stop_nutella_actors end # If running on the internal broker, stop it if needed if Nutella.runlist.empty? and Nutella.config['broker'] == 'localhost' stop_broker end # Output success message ( run_id, run, 'stopped' ) end |