Flowdock
method

repair_command

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: AltSystem

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.

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 53
    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.