Class: RuboCop::Cop::Homebrew::NoCommandLiteral Private

Inherits:
Base
  • Object
show all
Defined in:
rubocops/no_command_literal.rb

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Disallows shell command literals so command execution uses an explicit process API.

Constant Summary collapse

MSG =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"Use an explicit process API instead of a command literal. " \
"Pass arguments separately unless shell syntax is intentional."
RESTRICT_ON_SEND =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[:`].freeze

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • node (RuboCop::AST::SendNode)


20
21
22
# File 'rubocops/no_command_literal.rb', line 20

def on_send(node)
  add_offense(node)
end

#on_xstr(node) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:



15
16
17
# File 'rubocops/no_command_literal.rb', line 15

def on_xstr(node)
  add_offense(node)
end