123456789_123456789_123456789_123456789_123456789_

Module: RuboCop::Server Private

Overview

The bootstrap module for server.

Constant Summary

Class Attribute Summary

Class Method Summary

Class Attribute Details

.running?Boolean (readonly)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubocop/server.rb', line 33

def running?
  return false unless support_server? # Never running.

  Cache.pid_running?
end

.support_server?Boolean (readonly)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubocop/server.rb', line 29

def support_server?
  RUBY_ENGINE == 'ruby' && !RuboCop::Platform.windows?
end

Class Method Details

.wait_for_running_status!(expected)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/rubocop/server.rb', line 39

def wait_for_running_status!(expected)
  start_time = Time.now
  while Server.running? != expected
    sleep 0.1
    next unless Time.now - start_time > TIMEOUT

    warn "running? was not #{expected} after #{TIMEOUT} seconds!"
    exit 1
  end
end