Class: RuboCop::Server::ClientCommand::Base Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
RuboCop::Server::ClientCommand::Exec, RuboCop::Server::ClientCommand::Restart, RuboCop::Server::ClientCommand::Start, RuboCop::Server::ClientCommand::Status, RuboCop::Server::ClientCommand::Stop
|
|
Inherits: | Object |
Defined in: | lib/rubocop/server/client_command/base.rb |
Overview
Abstract base class for server client command.
Instance Method Summary
- #run Internal use only
- #check_running_server private Internal use only
- #send_request(command:, args: [], body: '') private Internal use only
Instance Method Details
#check_running_server (private)
[ GitHub ]#run
# File 'lib/rubocop/server/client_command/base.rb', line 21
def run raise NotImplementedError end
#send_request(command:, args: [], body: '') (private)
[ GitHub ]# File 'lib/rubocop/server/client_command/base.rb', line 27
def send_request(command:, args: [], body: '') TCPSocket.open('127.0.0.1', Cache.port_path.read) do |socket| socket.puts [Cache.token_path.read, Dir.pwd, command, *args].shelljoin socket.write body socket.close_write $stdout.write socket.readpartial(4096) until socket.eof? end end