Class: RuboCop::Server::ClientCommand::Exec Private

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/server/client_command/exec.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is a client command to execute server process.

Instance Method Summary collapse

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rubocop/server/client_command/exec.rb', line 18

def run
  ensure_server!
  Cache.status_path.delete if Cache.status_path.file?
  read_stdin = ARGV.include?('-s') || ARGV.include?('--stdin')
  send_request(
    command: 'exec',
    args: ARGV.dup,
    body: read_stdin ? $stdin.read : ''
  )
  warn stderr unless stderr.empty?
  status
end