Class: Frails::DevServer
- Inherits:
-
Object
- Object
- Frails::DevServer
- Defined in:
- lib/frails/dev_server.rb
Instance Method Summary collapse
- #host ⇒ Object
-
#host_with_port ⇒ Object
rubocop:enable Style/RescueStandardError.
- #port ⇒ Object
-
#running? ⇒ Boolean
rubocop:disable Style/RescueStandardError.
Instance Method Details
#host ⇒ Object
17 18 19 |
# File 'lib/frails/dev_server.rb', line 17 def host Frails.dev_server_host end |
#host_with_port ⇒ Object
rubocop:enable Style/RescueStandardError
13 14 15 |
# File 'lib/frails/dev_server.rb', line 13 def host_with_port "#{host}:#{port}" end |
#port ⇒ Object
21 22 23 |
# File 'lib/frails/dev_server.rb', line 21 def port Frails.dev_server_port end |
#running? ⇒ Boolean
rubocop:disable Style/RescueStandardError
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 |