Flowdock
method

repair_command

Importance_0
v1_9_3_392 - Show latest stable - 0 notes - Class: AltSystem
repair_command(cmd) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rake/alt_system.rb, line 51
    def repair_command(cmd)
      "call " + (
        if cmd =~ %\A\s*\".*?\"!
          # already quoted
          cmd
        elsif match = cmd.match(%\A\s*(\S+)!)
          if match[1] =~ %/!
            # avoid x/y.bat interpretation as x with option /y
            %"#{match[1]}"! + match.post_match
          else
            # a shell command will fail if quoted
            cmd
          end
        else
          # empty or whitespace
          cmd
        end
      )
    end
Register or log in to add new notes.