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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f4f2f8fc400f0ee136d5a0d10032d7c15d3d0a9411bf9bbbb6608d896ddb13f
4
- data.tar.gz: d2b70f2e5fa43fdc538eb7ae7ae06c620cf09efadf3b364a72889180b2dba02a
3
+ metadata.gz: 343581d49c2971d7066c9410b267dc83b896646737d91120020f382bfeafad0f
4
+ data.tar.gz: b7c853123e707167e60ebc42537d1c814ed787191c6f1ea8ae15c6dce27dc18e
5
5
  SHA512:
6
- metadata.gz: e810a25892496a161911863ff656e4626b705da64a692753bfa7b2fb2a36e9d8820293504a0202a951682b24494fb3d3437598cb8a047309113472ed4a81f946
7
- data.tar.gz: 3ad46d63e9922281d2930d1f02f47cc473bb1ad247672f095bd5d6208cfcf91d1f25237da03c9194783b90be0cbb9e009dd58c16f3100a7e4530f687f3b34766
6
+ metadata.gz: 63762868bc91631caf1ffd227ce7bc9632e4c5bc1838bc5be805341b5ca686264c0f1f645846b9dab025e4a157eca18b7f445333c193bdfa1bda38fd338a0b17
7
+ data.tar.gz: 53fb8ebab9d4ea42de8c4327cd5f626b94737b38c0a5b3d39bddf78d9bdd99ff4a1ba72c5501ab74632a3517a799726b794d9a2849f251c0cfd5228f5aa35807
@@ -8,9 +8,9 @@ before_script:
8
8
  - gem install bundler
9
9
 
10
10
  rvm:
11
- - 2.3
12
11
  - 2.4
13
12
  - 2.5
13
+ - 2.6
14
14
  - jruby-head
15
15
  - ruby-head
16
16
  - rbx-3
@@ -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")
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", "~> 1.3"
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/container/forked'
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
- @thread = nil
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
- @shared_endpoint ||= Async::Reactor.run do
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
- return Thread.new do
81
- container = Async::Container::Forked.new
82
-
83
- container.run(count: @options[:count], restart: true, name: "Guard::Falcon: #{endpoint}") do
84
- begin
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
- container.wait
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
- @thread = run_server
101
+ @container = run_server
102
102
  end
103
103
 
104
104
  def running?
105
- !@thread.nil?
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 @thread
115
- @thread.kill
116
- @thread.join
117
- @thread = nil
114
+ if @container
115
+ @container.stop(false)
116
+ @container = nil
118
117
  end
119
118
  end
120
119
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Guard
22
22
  module Falcon
23
- VERSION = "0.8.8"
23
+ VERSION = "0.9.0"
24
24
  end
25
25
  end
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.8
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-03-09 00:00:00.000000000 Z
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'
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.19'
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: '1.3'
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: '1.3'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement