Extract exit code from a process output. Returns the actual exit code, or
128 + signal per Unix convention when terminated by a signal (no exit code
available). Falls back to 1 on non-Unix platforms.
Extract exit code from an ExitStatus (for .status() calls, not .output()).
Returns the actual exit code, or 128 + signal per Unix convention when
terminated by a signal. Falls back to 1 on non-Unix platforms.
Build a Command for Ruby tools, auto-detecting bundle exec.
Uses bundle exec <tool> when a Gemfile exists (transitive deps like rake
won’t appear in the Gemfile but still need bundler for version isolation).
Extract short name from AWS ARN.
Example: arn:aws:ecs:region:acct:service/cluster/name -> name
For simple ARNs like arn:aws:iam::123:user/alice, returns alice.