File tree Expand file tree Collapse file tree 12 files changed +30
-28
lines changed
Expand file tree Collapse file tree 12 files changed +30
-28
lines changed Original file line number Diff line number Diff line change 1- /.bundle /
2- /pkg /
1+ /.bundle
2+ /pkg
33/gems.locked
44/.covered.db
55/external
66
7- /.bundle /
8- /.yardoc
9- /gems.locked
10- /_yardoc /
11- /coverage /
12- /doc /
13- /pkg /
14- /spec /reports /
15- /tmp /
16-
177.rspec_status
188.covered.db
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ Layout/EmptyLinesAroundModuleBody:
4848Layout/EmptyLineAfterMagicComment :
4949 Enabled : true
5050
51+ Layout/SpaceInsideBlockBraces :
52+ Enabled : true
53+ EnforcedStyle : no_space
54+ SpaceBeforeBlockParameters : false
55+
56+ Layout/SpaceAroundBlockParameters :
57+ Enabled : true
58+ EnforcedStyleInsidePipes : no_space
59+
5160Style/FrozenStringLiteralComment :
5261 Enabled : true
5362
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class App
2323 EOF
2424
2525 template = Trenni ::Template . new ( buffer )
26- body = DeferredBody . new ( -> ( stream ) { template . to_string ( { } , Output . new ( stream ) ) } )
26+ body = DeferredBody . new ( -> ( stream ) { template . to_string ( { } , Output . new ( stream ) ) } )
2727
2828 [ 200 , { } , body ]
2929 end
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ require "cgi"
44
55# curl 'http://localhost:9292/?xid=1%0DSet-Cookie:%20foo%3Dbar'
66
7- run -> ( env ) {
7+ run do | env |
88 params = CGI . parse env [ "QUERY_STRING" ]
99 header = params . fetch ( "xid" , [ ] ) . first || ""
1010
1111 [ 200 , { "xid" => "m" + header } , [ "hello" ] ]
12- }
12+ end
Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
22# frozen_string_literal: true
33
4+ # Released under the MIT License.
5+ # Copyright, 2025, by Samuel Williams.
6+
47require "async/http"
58require "async/http/internet/instance"
69
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class BodyHandler
4141 end
4242end
4343
44- run lambda { |env |
44+ run do |env |
4545 request = env [ "protocol.http.request" ]
4646 handler = BodyHandler . new ( env [ "rack.input" ] , env [ "CONTENT_LENGTH" ] )
4747 Console . info ( self , "#{ env [ 'REQUEST_METHOD' ] } #{ handler . uuid } : #{ request . path } #{ env [ 'CONTENT_LENGTH' ] } " )
@@ -60,4 +60,4 @@ run lambda { |env|
6060 sleep 1
6161 [ 200 , { } , [ "#{ env [ 'REQUEST_METHOD' ] } : #{ request . path } \n " ] ]
6262 end
63- }
63+ end
Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ use RequestLogger
1818run lambda { |env |
1919 start_time = Async ::Clock . now
2020
21- server_timing = -> {
22- "app;dur=#{ Async ::Clock . now - start_time } "
23- }
21+ server_timing = -> { "app;dur=#{ Async ::Clock . now - start_time } " }
2422
2523 [
2624 200 ,
Original file line number Diff line number Diff line change 1111 include Falcon ::Environment ::Rack
1212
1313 scheme "http"
14- protocol { Async ::HTTP ::Protocol ::HTTP1 . new (
15- persistent : false ,
16- ) }
14+ protocol do
15+ Async ::HTTP ::Protocol ::HTTP1 . new (
16+ persistent : false ,
17+ )
18+ end
1719
1820 # Extend the endpoint options to include the (connection) limited wrapper.
1921 endpoint_options do
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33# This echos the body back.
4- run lambda { |env | [ 200 , { } , env [ "rack.input" ] || [ ] ] }
4+ run lambda { |env | [ 200 , { } , env [ "rack.input" ] || [ ] ] }
Original file line number Diff line number Diff line change 3737end
3838
3939describe Falcon ::Command ::Serve do
40- let ( :options ) { [ ] }
40+ let ( :options ) { [ ] }
4141
4242 with "custom port" do
4343 let ( :port ) { 8090 }
You can’t perform that action at this time.
0 commit comments