class Shellany::Sheller
def self._shellize_if_needed(args)
def self._shellize_if_needed(args) return args unless RUBY_PLATFORM == "java" return args unless args.size == 1 return args unless /[;<>]/ =~ args.first # NOTE: Sheller was originally meant for Guard (which basically only uses # UNIX commands anyway) and JRuby doesn't support options to # Kernel.system (and doesn't automatically shell when there's a # metacharacter in the command). # # So ... I'm assuming /bin/sh exists - if not, PRs are welcome, # because I have no clue what to do if /bin/sh doesn't exist. # (use ENV["RUBYSHELL"] ? Detect cmd.exe ?) ["/bin/sh", "-c", args.first] end