8000 Migrate to sus and update several examples. · Hanke/async-websocket@3d498aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d498aa

Browse files
committed
Migrate to sus and update several examples.
1 parent 1c36f02 commit 3d498aa

File tree

18 files changed

+184
-405
lines changed

18 files changed

+184
-405
lines changed

async-websocket.gemspec

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ Gem::Specification.new do |spec|
2222
spec.add_dependency "protocol-rack", "~> 0.1.1"
2323
spec.add_dependency "protocol-websocket", "~> 0.9.1"
2424

25-
spec.add_development_dependency "async-rspec"
2625
spec.add_development_dependency "bundler"
2726
spec.add_development_dependency "covered"
28-
spec.add_development_dependency "falcon", "~> 0.34"
29-
spec.add_development_dependency "rack-test"
30-
spec.add_development_dependency "rspec", "~> 3.6"
27+
spec.add_development_dependency "sus", "~> 0.12.0"
28+
spec.add_development_dependency "sus-fixtures-async-http", "~> 0.2.3"
3129
end

config/sus.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'covered/sus'
2+
include Covered::Sus

examples/rack/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
endpoint = Async::HTTP::Endpoint.parse(URL)
1111

1212
Async::WebSocket::Client.connect(endpoint) do |connection|
13-
connection.write ["Hello", "World"]
13+
connection.send_text("Hello World")
14+
connection.flush
1415

1516 while message = connection.read
1617
p message

examples/rack/config.ru

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
require 'async/websocket/adapters/rack'
44

55
app = lambda do |env|
6-
Async::WebSocket::Adapters::Rack.open(env) do |connection|
7-
message = connection.read
8-
connection.write message.reverse
9-
end
6+
response = Async::WebSocket::Adapters::Rack.open(env) do |connection|
7+
while message = connection.read
8+
connection.write message
9+
end
10+
end or [404, {}, []]
1011
end
1112

1213
run app

examples/rack/gems.locked

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
PATH
2+
remote: ../..
3+
specs:
4+
async-websocket (0.22.0)
5+
async-http (~> 0.54)
6+
async-io (~> 1.23)
7+
protocol-rack (~> 0.1.1)
8+
protocol-websocket (~> 0.9.1)
9+
10+
PATH
11+
remote: /Users/samuel/Projects/socketry/protocol-rack
12+
specs:
13+
protocol-rack (0.1.5)
14+
protocol-http (~> 0.23.4)
15+
rack (>= 1.0)
16+
17+
GEM
18+
remote: https://rubygems.org/
19+
specs:
20+
async (2.0.3)
21+
console (~> 1.10)
22+
io-event (~> 1.0.0)
23+
timers (~> 4.1)
24+
async-container (0.16.12)
25+
async
26+
async-io
27+
async-http (0.59.1)
28+
async (>= 1.25)
29+
async-io (>= 1.28)
30+
async-pool (>= 0.2)
31+
protocol-http (~> 0.23.1)
32+
protocol-http1 (~> 0.14.0)
33+
protocol-http2 (~> 0.14.0)
34+
traces (>= 0.4.0)
35+
async-http-cache (0.4.2)
36+
async-http (~> 0.56)
37+
async-io (1.33.0)
38+
async
39+
async-pool (0.3.11)
40+
async (>= 1.25)
41+
build-environment (1.13.0)
42+
console (1.15.3)
43+
fiber-local
44+
falcon (0.42.2)
45+
async
46+
async-container (~> 0.16.0)
47+
async-http (~> 0.57)
48+
async-http-cache (~> 0.4.0)
49+
async-io (~> 1.22)
50+
build-environment (~> 1.13)
51+
bundler
52+
localhost (~> 1.1)
53+
openssl (~> 3.0)
54+
process-metrics (~> 0.2.0)
55+
protocol-rack (~> 0.1.4)
56+
samovar (~> 2.1)
57+
fiber-local (1.0.0)
58+
io-event (1.0.9)
59+
localhost (1.1.9)
60+
mapping (1.1.1)
61+
nio4r (2.5.8)
62+
openssl (3.0.0)
63+
process-metrics (0.2.1)
64+
console (~> 1.8)
65+
samovar (~> 2.1)
66+
protocol-hpack (1.4.2)
67+
protocol-http (0.23.5)
68+
protocol-http1 (0.14.4)
69+
protocol-http (~> 0.22)
70+
protocol-http2 (0.14.2)
71+
protocol-hpack (~> 1.4)
72+
protocol-http (~> 0.18)
73+
protocol-websocket (0.9.1)
74+
protocol-http (~> 0.2)
75+
protocol-http1 (~> 0.2)
76+
puma (5.6.4)
77+
nio4r (~> 2.0)
78+
rack (2.2.4)
79+
samovar (2.1.4)
80+
console (~> 1.0)
81+
mapping (~> 1.0)
82+
timers (4.3.3)
83+
traces (0.6.1)
84+
85+
PLATFORMS
86+
arm64-darwin-21
87+
88+
DEPENDENCIES
89+
async-websocket!
90+
falcon
91+
protocol-rack!
92+
puma
93+
94+
BUNDLED WITH
95+
2.3.10

examples/rack/gems.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source "https://rubygems.org"
2+
3+
gem "puma"
4+
gem "falcon"
5+
6+
gem "async-websocket", path: "../../"
7+
gem "protocol-rack"

examples/utopia/.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.6
1+
3.1.2

examples/utopia/gems.locked

Lines changed: 0 additions & 241 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0