class Utils::Editor
def cmd(*parts)
-
(Boolean)
- true if the command was successful, false otherwise
Parameters:
-
parts
(Array
) -- the parts to be included in the command
def cmd(*parts) command = parts.compact.inject([]) do |a, p| case when p == nil, p == [] a when p.respond_to?(:to_ary) a.concat p.to_ary else a << p.to_s end end $DEBUG and warn command * ' ' system(*command.map(&:to_s)) end