Class: Frails::DevServer

Inherits:
Object
  • Object
show all
Defined in:
lib/frails/dev_server.rb

Instance Method Summary collapse

Instance Method Details

#hostObject



17
18
19
# File 'lib/frails/dev_server.rb', line 17

def host
  Frails.dev_server_host
end

#host_with_portObject

rubocop:enable Style/RescueStandardError



13
14
15
# File 'lib/frails/dev_server.rb', line 13

def host_with_port
  "#{host}:#{port}"
end

#portObject



21
22
23
# File 'lib/frails/dev_server.rb', line 21

def port
  Frails.dev_server_port
end

#running?Boolean

rubocop:disable Style/RescueStandardError

Returns:

  • (Boolean)


5
6
7
8
9
10
# File 'lib/frails/dev_server.rb', line 5

def running?
  Socket.tcp(host, port, connect_timeout: 0.01).close
  true
rescue
  false
end