guard-falcon 0.8.8 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/guard-falcon.gemspec +2 -2
- data/lib/guard/falcon/controller.rb +25 -26
- data/lib/guard/falcon/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 343581d49c2971d7066c9410b267dc83b896646737d91120020f382bfeafad0f
|
4
|
+
data.tar.gz: b7c853123e707167e60ebc42537d1c814ed787191c6f1ea8ae15c6dce27dc18e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63762868bc91631caf1ffd227ce7bc9632e4c5bc1838bc5be805341b5ca686264c0f1f645846b9dab025e4a157eca18b7f445333c193bdfa1bda38fd338a0b17
|
7
|
+
data.tar.gz: 53fb8ebab9d4ea42de8c4327cd5f626b94737b38c0a5b3d39bddf78d9bdd99ff4a1ba72c5501ab74632a3517a799726b794d9a2849f251c0cfd5228f5aa35807
|
data/.travis.yml
CHANGED
data/guard-falcon.gemspec
CHANGED
@@ -16,12 +16,12 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency("falcon", "~> 0.
|
19
|
+
spec.add_dependency("falcon", "~> 0.31")
|
20
20
|
|
21
21
|
spec.add_dependency("guard")
|
22
22
|
spec.add_dependency("guard-compat", "~> 1.2")
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "bundler"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.6"
|
26
26
|
spec.add_development_dependency "rake"
|
27
27
|
end
|
@@ -23,10 +23,10 @@ require 'guard/compat/plugin'
|
|
23
23
|
require 'rack/builder'
|
24
24
|
require 'rack/server'
|
25
25
|
|
26
|
-
require 'async/
|
26
|
+
require 'async/logger'
|
27
|
+
require 'async/container'
|
27
28
|
|
28
29
|
require 'async/io/host_endpoint'
|
29
|
-
require 'async/http/url_endpoint'
|
30
30
|
require 'async/io/shared_endpoint'
|
31
31
|
|
32
32
|
require 'falcon/server'
|
@@ -46,7 +46,7 @@ module Guard
|
|
46
46
|
|
47
47
|
@options = DEFAULT_OPTIONS.merge(options)
|
48
48
|
@endpoint = nil
|
49
|
-
@
|
49
|
+
@container = nil
|
50
50
|
end
|
51
51
|
|
52
52
|
# As discussed in https://github.com/guard/guard/issues/713
|
@@ -70,39 +70,39 @@ module Guard
|
|
70
70
|
@endpoint ||= build_endpoint
|
71
71
|
end
|
72
72
|
|
73
|
-
def run_server
|
74
|
-
|
73
|
+
def run_server(container = Async::Container.new)
|
74
|
+
bound_endpoint ||= Async::Reactor.run do
|
75
75
|
Async::IO::SharedEndpoint.bound(endpoint)
|
76
76
|
end.wait
|
77
77
|
|
78
78
|
logger.info("Starting Falcon HTTP server on #{endpoint}.")
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
rack_app, options = Rack::Builder.parse_file(@options[:config])
|
86
|
-
rescue => error
|
87
|
-
logger.error(error) {"Failed to load #{@options[:config]}"}
|
88
|
-
end
|
89
|
-
|
90
|
-
app = ::Falcon::Server.middleware(rack_app, verbose: @options[:verbose])
|
91
|
-
server = ::Falcon::Server.new(app, @shared_endpoint, endpoint.protocol, endpoint.scheme)
|
92
|
-
|
93
|
-
server.run
|
80
|
+
container.run(count: @options[:count], restart: true, name: "Guard::Falcon: #{endpoint}") do
|
81
|
+
begin
|
82
|
+
rack_app, options = Rack::Builder.parse_file(@options[:config])
|
83
|
+
rescue => error
|
84
|
+
logger.error(error) {"Failed to load #{@options[:config]}"}
|
94
85
|
end
|
95
86
|
|
96
|
-
|
87
|
+
app = ::Falcon::Server.middleware(rack_app, verbose: @options[:verbose])
|
88
|
+
server = ::Falcon::Server.new(app, bound_endpoint, endpoint.protocol, endpoint.scheme)
|
89
|
+
|
90
|
+
server.run
|
97
91
|
end
|
92
|
+
|
93
|
+
container.attach do
|
94
|
+
bound_endpoint.close
|
95
|
+
end
|
96
|
+
|
97
|
+
return container
|
98
98
|
end
|
99
99
|
|
100
100
|
def start
|
101
|
-
@
|
101
|
+
@container = run_server
|
102
102
|
end
|
103
103
|
|
104
104
|
def running?
|
105
|
-
!@
|
105
|
+
!@container.nil?
|
106
106
|
end
|
107
107
|
|
108
108
|
def reload
|
@@ -111,10 +111,9 @@ module Guard
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def stop
|
114
|
-
if @
|
115
|
-
@
|
116
|
-
@
|
117
|
-
@thread = nil
|
114
|
+
if @container
|
115
|
+
@container.stop(false)
|
116
|
+
@container = nil
|
118
117
|
end
|
119
118
|
end
|
120
119
|
|
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.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: falcon
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.31'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.31'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: guard
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|