falcon 0.16.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/falcon/command/serve.rb +1 -17
- data/lib/falcon/server.rb +19 -1
- data/lib/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: 8727836e374353d67e66492cf12b364f2b2af46de80b5027f970834886a90653
|
4
|
+
data.tar.gz: 9139b6c87723b21bc4001b2ee488139ad1fd116f23d6786b697e879ad39b0e65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99e3d5044ddbb175bbe969ddd1dc90bfedf1e9551b700aa835adec89e646fb9591d4ad29c7fe95ae2935788997de84bb9187d2e9c658489933c333fb0f744b0a
|
7
|
+
data.tar.gz: 3e38a92a250bb8b0afa387e03a8c6919a3c1fae89333a7bed96f931feb544e4dabd81348b22ade0674565268690264f870516ab1e0d79dc6328de07b2efa3d59
|
data/lib/falcon/command/serve.rb
CHANGED
@@ -19,16 +19,12 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
require_relative '../server'
|
22
|
-
require_relative '../verbose'
|
23
|
-
require_relative '../adapters/rack'
|
24
22
|
|
25
23
|
require 'async/container'
|
26
24
|
require 'async/io/trap'
|
27
25
|
require 'async/io/host_endpoint'
|
28
26
|
require 'async/io/shared_endpoint'
|
29
27
|
|
30
|
-
require 'async/http/middleware/builder'
|
31
|
-
|
32
28
|
require 'samovar'
|
33
29
|
|
34
30
|
require 'rack/builder'
|
@@ -62,19 +58,7 @@ module Falcon
|
|
62
58
|
def load_app(verbose)
|
63
59
|
rack_app, options = Rack::Builder.parse_file(@options[:config])
|
64
60
|
|
65
|
-
|
66
|
-
if verbose
|
67
|
-
use Verbose
|
68
|
-
end
|
69
|
-
|
70
|
-
use Async::HTTP::ContentEncoding
|
71
|
-
use Adapters::Rewindable
|
72
|
-
use Adapters::Rack
|
73
|
-
|
74
|
-
run rack_app
|
75
|
-
end
|
76
|
-
|
77
|
-
return app, options
|
61
|
+
return Server.middleware(rack_app, verbose: verbose), options
|
78
62
|
end
|
79
63
|
|
80
64
|
def run(verbose)
|
data/lib/falcon/server.rb
CHANGED
@@ -19,10 +19,28 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
require 'async/http/server'
|
22
|
+
require 'async/http/middleware/builder'
|
23
|
+
|
22
24
|
require 'async/http/content_encoding'
|
23
25
|
|
26
|
+
require_relative 'verbose'
|
24
27
|
require_relative 'adapters/rewindable'
|
28
|
+
require_relative 'adapters/rack'
|
25
29
|
|
26
30
|
module Falcon
|
27
|
-
Server
|
31
|
+
class Server < Async::HTTP::Server
|
32
|
+
def self.middleware(rack_app, verbose: false)
|
33
|
+
Async::HTTP::Middleware.build do
|
34
|
+
if verbose
|
35
|
+
use Verbose
|
36
|
+
end
|
37
|
+
|
38
|
+
use Async::HTTP::ContentEncoding
|
39
|
+
use Adapters::Rewindable
|
40
|
+
use Adapters::Rack
|
41
|
+
|
42
|
+
run rack_app
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
28
46
|
end
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.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: 2018-06-
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|