guard-falcon 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/guard/falcon/controller.rb +18 -13
- data/lib/guard/falcon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3676ac57e79592600ac1dfc7ea5120895404ec3fe6b8986e113771e095c41fff
|
4
|
+
data.tar.gz: e26192fef8832eb9e5f3bda26375aa15d8298c451b1839115549d676cca45c89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c167fcfd0dd061063c15653e5e95babe108965671b02ce227d641919bc1cc1ba99c198c7400be9e5f13c981c5356fdce1d565e1b1290d5e76030364f0cf23e96
|
7
|
+
data.tar.gz: 1b428c99e81026da466f423fbf3467633e21371cb8e509be824ef175a73d77469d6de336c655006ff3569162df9209edac55d42e8e84897aaa99dd745c13bb0d
|
@@ -30,6 +30,7 @@ require 'async/http/url_endpoint'
|
|
30
30
|
require 'async/io/shared_endpoint'
|
31
31
|
|
32
32
|
require 'falcon/server'
|
33
|
+
require 'falcon/endpoint'
|
33
34
|
|
34
35
|
module Guard
|
35
36
|
module Falcon
|
@@ -53,30 +54,30 @@ module Guard
|
|
53
54
|
Compat::UI
|
54
55
|
end
|
55
56
|
|
56
|
-
private def
|
57
|
+
private def build_endpoint
|
57
58
|
# Support existing use cases where only port: is specified.
|
58
59
|
if @options[:endpoint]
|
59
|
-
|
60
|
-
elsif port = @options[:port]
|
61
|
-
host = @options[:host] || 'localhost'
|
62
|
-
endpoint = Async::IO::Endpoint.tcp(host, port, reuse_port: true)
|
60
|
+
return @options[:endpoint]
|
63
61
|
else
|
64
|
-
|
62
|
+
url = @options.fetch(:url, "http://localhost")
|
63
|
+
port = @options.fetch(:port, 9292)
|
64
|
+
|
65
|
+
return ::Falcon::Endpoint.parse(url, port: port)
|
65
66
|
end
|
66
|
-
|
67
|
-
Async::Reactor.run do
|
68
|
-
Async::IO::SharedEndpoint.bound(endpoint)
|
69
|
-
end.result
|
70
67
|
end
|
71
68
|
|
72
69
|
def endpoint
|
73
|
-
@endpoint ||=
|
70
|
+
@endpoint ||= build_endpoint
|
74
71
|
end
|
75
72
|
|
76
73
|
def run_server
|
74
|
+
shared_endpoint = Async::Reactor.run do
|
75
|
+
Async::IO::SharedEndpoint.bound(endpoint)
|
76
|
+
end.result
|
77
|
+
|
77
78
|
logger.info("Starting Falcon HTTP server on #{endpoint}.")
|
78
79
|
|
79
|
-
Async::Container::Forked.new(concurrency: @options[:concurrency]) do
|
80
|
+
container = Async::Container::Forked.new(concurrency: @options[:concurrency]) do
|
80
81
|
begin
|
81
82
|
rack_app, options = Rack::Builder.parse_file(@options[:config])
|
82
83
|
rescue
|
@@ -85,12 +86,16 @@ module Guard
|
|
85
86
|
end
|
86
87
|
|
87
88
|
app = ::Falcon::Server.middleware(rack_app, verbose: @options[:verbose])
|
88
|
-
server = ::Falcon::Server.new(app,
|
89
|
+
server = ::Falcon::Server.new(app, shared_endpoint, endpoint.protocol)
|
89
90
|
|
90
91
|
Process.setproctitle "Guard::Falcon HTTP Server: #{endpoint}"
|
91
92
|
|
92
93
|
server.run
|
93
94
|
end
|
95
|
+
|
96
|
+
shared_endpoint.close
|
97
|
+
|
98
|
+
return container
|
94
99
|
end
|
95
100
|
|
96
101
|
def start
|
data/lib/guard/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: falcon
|