falcon 0.18.4 → 0.18.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -4
- data/lib/falcon/adapters/input.rb +6 -9
- data/lib/falcon/command/serve.rb +25 -2
- data/lib/falcon/endpoint.rb +0 -2
- 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: b4d63d513ba1b965c6bf1daac83887462ec92fed030577444dee6fd7bfb4c3b1
|
4
|
+
data.tar.gz: 2fd3e47bab391fe6f2eb8e139c73d923f5bbd3672fc3c5ce7eea2d28a990742b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c888c2a1b3989666c33ecb5f1ebd33e65a917a17f3062bf6a1251afb05299a0da2ccb0e493ffee85d42f7c6ab6d7a03d64169ee3a05a1428516af8f25722c3c2
|
7
|
+
data.tar.gz: e145e42827ed9b38ff59c0ca44c43c4965a1e6ef3c9806a90db299896f40f204c94a5011db2da86d6f1d178572e6c5c19aa34b628dab6185af16c12b6adbbb84
|
data/.travis.yml
CHANGED
@@ -47,21 +47,18 @@ module Falcon
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# rewind must be called without arguments. It rewinds the input stream back to the beginning. It must not raise Errno::ESPIPE: that is, it may not be a pipe or a socket. Therefore, handler developers must buffer the input data into some rewindable object if the underlying input stream is not rewindable.
|
50
|
+
# @return [Boolean] whether the body could be rewound.
|
50
51
|
def rewind
|
51
|
-
if @body
|
52
|
+
if @body and @body.respond_to? :rewind
|
52
53
|
# If the body is not rewindable, this will fail.
|
53
54
|
@body.rewind
|
54
55
|
@buffer = nil
|
55
56
|
@finished = false
|
57
|
+
|
58
|
+
return true
|
56
59
|
end
|
57
|
-
|
58
|
-
|
59
|
-
def respond_to?(name, *)
|
60
|
-
if name == :rewind
|
61
|
-
@body.respond_to?(:rewind)
|
62
|
-
else
|
63
|
-
super
|
64
|
-
end
|
60
|
+
|
61
|
+
return false
|
65
62
|
end
|
66
63
|
|
67
64
|
# read behaves like IO#read. Its signature is read([length, [buffer]]). If given, length must be a non-negative Integer (>= 0) or nil, and buffer must be a String and may not be nil. If length is given and not nil, then this method reads at most length bytes from the input stream. If length is not given or nil, then this method reads all data until EOF. When EOF is reached, this method returns nil if length is given and not nil, or “” if length is not given or is nil. If buffer is given, then the read data will be placed into buffer instead of a newly created String object.
|
data/lib/falcon/command/serve.rb
CHANGED
@@ -68,10 +68,33 @@ module Falcon
|
|
68
68
|
return Server.middleware(rack_app, verbose: verbose), options
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def endpoint_options
|
72
|
+
# Oh, for Hash#slice(keys...)
|
73
|
+
options = {}
|
74
|
+
|
75
|
+
if @options[:hostname]
|
76
|
+
options[:hostname] = @options[:hostname]
|
77
|
+
end
|
78
|
+
|
79
|
+
if @options[:port]
|
80
|
+
options[:port] = @options[:port]
|
81
|
+
end
|
82
|
+
|
83
|
+
return options
|
84
|
+
end
|
85
|
+
|
86
|
+
def client_endpoint
|
87
|
+
Async::HTTP::URLEndpoint.parse(@options[:bind], **endpoint_options)
|
88
|
+
end
|
89
|
+
|
90
|
+
def client
|
91
|
+
Async::HTTP::Client.new(client_endpoint)
|
92
|
+
end
|
93
|
+
|
94
|
+
def run(verbose = false)
|
72
95
|
app, options = load_app(verbose)
|
73
96
|
|
74
|
-
endpoint = Endpoint.parse(@options[:bind],
|
97
|
+
endpoint = Endpoint.parse(@options[:bind], **endpoint_options)
|
75
98
|
|
76
99
|
bound_endpoint = Async::Reactor.run do
|
77
100
|
Async::IO::SharedEndpoint.bound(endpoint)
|
data/lib/falcon/endpoint.rb
CHANGED
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.18.
|
4
|
+
version: 0.18.5
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|