Method: Makit::Commands::Request.from_string
- Defined in:
- lib/makit/commands/request.rb
.from_string(command_string, **options) ⇒ Request
Create a request from a shell command string.
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/makit/commands/request.rb', line 113 def self.from_string(command_string, **) raise ArgumentError, "Command string cannot be empty" if command_string.nil? || command_string.strip.empty? # Parse shell command string into command and arguments parts = Shellwords.split(command_string.strip) command = parts.shift arguments = parts new(command: command, arguments: arguments, **) end |