Class: RuboCop::Server::ClientCommand::Start Private
- Defined in:
- lib/rubocop/server/client_command/start.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 start server process.
Instance Method Summary collapse
- #run ⇒ Object private
Instance Method Details
#run ⇒ Object
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 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rubocop/server/client_command/start.rb', line 18 def run if Server.running? warn "RuboCop server (#{Cache.pid_path.read}) is already running." return end Cache.acquire_lock do |locked| unless locked # Another process is already starting server, # so wait for it to be ready. Server.wait_for_running_status!(true) exit 0 end Cache.write_version_file(RuboCop::Version::STRING) host = ENV.fetch('RUBOCOP_SERVER_HOST', '127.0.0.1') port = ENV.fetch('RUBOCOP_SERVER_PORT', 0) Server::Core.new.start(host, port) end end |