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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd104c6caded08d942fe3f10b02da4f36f3b70bc3bb0a702ab75c23174f19aaf
4
- data.tar.gz: 1da885898be44a88bd10dc81000ed8a13e5a2e17c6b3eacddc262406992cafec
3
+ metadata.gz: b4d63d513ba1b965c6bf1daac83887462ec92fed030577444dee6fd7bfb4c3b1
4
+ data.tar.gz: 2fd3e47bab391fe6f2eb8e139c73d923f5bbd3672fc3c5ce7eea2d28a990742b
5
5
  SHA512:
6
- metadata.gz: 7c67ecf92798eefc8f509fc84141bdb695ab00cbda5e4c19004e0755f9ba28b1c1472ed1f0bc7638a951ca89a4b98d7d0b04b6dd17a708121ee4a271adfda0cf
7
- data.tar.gz: ada1b7fff3d46c9805a0e21dc19484b18a0c3bfd1165ded486bfc1e82117177bdec0693d2af761b4cc67daa8152690a30f93a4fd5c06f41e5f556081f6c0b92d
6
+ metadata.gz: c888c2a1b3989666c33ecb5f1ebd33e65a917a17f3062bf6a1251afb05299a0da2ccb0e493ffee85d42f7c6ab6d7a03d64169ee3a05a1428516af8f25722c3c2
7
+ data.tar.gz: e145e42827ed9b38ff59c0ca44c43c4965a1e6ef3c9806a90db299896f40f204c94a5011db2da86d6f1d178572e6c5c19aa34b628dab6185af16c12b6adbbb84
@@ -9,10 +9,6 @@ addons:
9
9
  - wrk
10
10
  - apache2-utils
11
11
 
12
- before_script:
13
- - gem update --system
14
- - gem install bundler
15
-
16
12
  matrix:
17
13
  include:
18
14
  - rvm: 2.3
@@ -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
- end
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.
@@ -68,10 +68,33 @@ module Falcon
68
68
  return Server.middleware(rack_app, verbose: verbose), options
69
69
  end
70
70
 
71
- def run(verbose)
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], reuse_port: true)
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)
@@ -43,8 +43,6 @@ module Falcon
43
43
  end
44
44
 
45
45
  context.session_id_context = "falcon"
46
- context.set_params
47
- context.freeze
48
46
  end
49
47
  end
50
48
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.18.4"
22
+ VERSION = "0.18.5"
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.18.4
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-09 00:00:00.000000000 Z
11
+ date: 2018-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-io