module Shell class Runner # define launch work def launch tool_name = ARGV.first ? ARGV.first.downcase : nil if tool_name && Shell::TOOLS.include?(tool_name.to_sym) require_relative "docker/#{tool_name}" command = "#{ARGV[1..(ARGV.length+1)].join(" ")}" case ARGV.first when 'php' Shell::Php.exec(command) when 'composer' Shell::Composer.exec(command) when 'yarn' Shell::Yarn.exec(command) else show_error end else show_error end end def show_error tools = Shell::TOOLS.map { |tool| tool.to_s }.join(", ") UI.error("Tool not found. Try one of these: #{tools}") end end end