Method: Utils::Editor#cmd
- Defined in:
- lib/utils/editor.rb
#cmd(*parts) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/utils/editor.rb', line 84 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 |