Securely handle user-supplied values
mainTo prevent security vulnerabilities, only pass user-generated data into the run method, not the new method.
Terrapin escapes arguments passed to run (interpolations), but it does not escape the command template passed to new. If you pass user input directly into new, it will be executed as part of the raw shell command.
Incorrect (Unsafe):
line = Terrapin::CommandLine.new("echo", "haha`whoami`")
line.run # Executes whoamiCorrect (Safe):
line = Terrapin::CommandLine.new("echo", "haha:whoami")
line.run(whoami: "`whoami`") # Escapes the input safely