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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d9fc7ea8d8bf2ecbb8b35f6a76aa5962f4a12878e3777a3ae62914cd219dfb2
4
- data.tar.gz: 9b83c5cc050cee1c6bf9019880b54e9179689135d53e09138648819ad3f0bec6
3
+ metadata.gz: 8727836e374353d67e66492cf12b364f2b2af46de80b5027f970834886a90653
4
+ data.tar.gz: 9139b6c87723b21bc4001b2ee488139ad1fd116f23d6786b697e879ad39b0e65
5
5
  SHA512:
6
- metadata.gz: 8b1b0faad2845f854637a85bccc2f77ed9fe9426e6bf0a91d6211f8bc75921c8f9e9de7470334cff351577562255e9dc552f7cc5197bd2032207e3825037b970
7
- data.tar.gz: ffe14cbbec5baed63e37c0f2a721ef8be77b6f05e1304184aaa1c1a461408e149705dfd7ed726cccb8aa4b5865710415be2158b5e1e25f177c0696314f293c6e
6
+ metadata.gz: 99e3d5044ddbb175bbe969ddd1dc90bfedf1e9551b700aa835adec89e646fb9591d4ad29c7fe95ae2935788997de84bb9187d2e9c658489933c333fb0f744b0a
7
+ data.tar.gz: 3e38a92a250bb8b0afa387e03a8c6919a3c1fae89333a7bed96f931feb544e4dabd81348b22ade0674565268690264f870516ab1e0d79dc6328de07b2efa3d59
@@ -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
- app = Async::HTTP::Middleware.build do
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 = Async::HTTP::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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.16.1"
22
+ VERSION = "0.17.0"
23
23
  end
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.16.1
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-27 00:00:00.000000000 Z
11
+ date: 2018-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-io