module CLI::Start
Methods for starting Robot Sweatshop
Public Class Methods
generate_eye_config()
click to toggle source
# File lib/robot_sweatshop/cli/start.rb, line 23 def self.generate_eye_config template = File.read "#{__dir__}/robot_sweatshop.eye.erb" eruby = Erubis::Eruby.new template compiled_config = eruby.result worker_count: configatron.worker_count compiled_config_file = File.expand_path '~/.robot_sweatshop/robot_sweatshop.eye' File.open compiled_config_file, 'w' do |file| file.write compiled_config file.path end end
load_eye_config()
click to toggle source
# File lib/robot_sweatshop/cli/start.rb, line 15 def self.load_eye_config Config.compile_to_file output = `eye load #{generate_eye_config}` fail output if $?.exitstatus != 0 Announce.success "Robot Sweatshop loaded" Announce.info 'Run \'eye --help\' for more info on debugging' end
sweatshop()
click to toggle source
# File lib/robot_sweatshop/cli/start.rb, line 9 def self.sweatshop Announce.info `eye stop robot_sweatshop:workers` load_eye_config Announce.info `eye restart robot_sweatshop` end