diff --git a/gleam.toml b/gleam.toml index 5ab81ee..3417040 100644 --- a/gleam.toml +++ b/gleam.toml @@ -6,9 +6,9 @@ repository = { type = "github", user = "rawhat", repo = "glisten" } gleam = ">= 0.32.0" [dependencies] -gleam_stdlib = "~> 0.30" -gleam_otp = "~> 0.7" -gleam_erlang = "~> 0.22" +gleam_stdlib = "~> 0.32" +gleam_otp = "~> 0.8" +gleam_erlang = "~> 0.23" [dev-dependencies] -gleeunit = "~> 0.10" +gleeunit = "~> 1.0" diff --git a/manifest.toml b/manifest.toml index 85bc69d..65a4a42 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,14 +2,14 @@ # You typically do not need to edit this file packages = [ - { name = "gleam_erlang", version = "0.22.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "367D8B41A7A86809928ED1E7E55BFD0D46D7C4CF473440190F324AFA347109B4" }, - { name = "gleam_otp", version = "0.7.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_erlang"], otp_app = "gleam_otp", source = "hex", outer_checksum = "ED7381E90636E18F5697FD7956EECCA635A3B65538DC2BE2D91A38E61DCE8903" }, - { name = "gleam_stdlib", version = "0.30.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "704258528887F95075FFED7AAE1CCF836A9B88E3AADA2F69F9DA15815F94A4F9" }, - { name = "gleeunit", version = "0.11.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "1397E5C4AC4108769EE979939AC39BF7870659C5AFB714630DEEEE16B8272AD5" }, + { name = "gleam_erlang", version = "0.23.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "DA7A8E5540948DE10EB01B530869F8FF2FF6CAD8CFDA87626CE6EF63EBBF87CB" }, + { name = "gleam_otp", version = "0.8.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "18EF8242A5E54BA92F717C7222F03B3228AEE00D1F286D4C56C3E8C18AA2588E" }, + { name = "gleam_stdlib", version = "0.32.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "ABF00CDCCB66FABBCE351A50060964C4ACE798F95A0D78622C8A7DC838792577" }, + { name = "gleeunit", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D3682ED8C5F9CAE1C928F2506DE91625588CC752495988CBE0F5653A42A6F334" }, ] [requirements] -gleam_erlang = { version = "~> 0.22" } -gleam_otp = { version = "~> 0.7" } -gleam_stdlib = { version = "~> 0.30" } -gleeunit = { version = "~> 0.10" } +gleam_erlang = { version = "~> 0.23" } +gleam_otp = { version = "~> 0.8" } +gleam_stdlib = { version = "~> 0.32" } +gleeunit = { version = "~> 1.0" } diff --git a/src/glisten/handler.gleam b/src/glisten/handler.gleam index 6ec7536..40d869e 100644 --- a/src/glisten/handler.gleam +++ b/src/glisten/handler.gleam @@ -85,7 +85,7 @@ pub fn start( atom.create_from_string("tcp"), fn(_sock, data) { data - |> dynamic.bit_string + |> dynamic.bit_array |> result.unwrap(<<>>) |> ReceiveMessage }, @@ -94,7 +94,7 @@ pub fn start( atom.create_from_string("ssl"), fn(_sock, data) { data - |> dynamic.bit_string + |> dynamic.bit_array |> result.unwrap(<<>>) |> ReceiveMessage }, diff --git a/test/glisten_test.gleam b/test/glisten_test.gleam index 0f6e654..bd767ff 100644 --- a/test/glisten_test.gleam +++ b/test/glisten_test.gleam @@ -1,4 +1,4 @@ -import gleam/bit_builder +import gleam/bytes_builder import gleam/dynamic import gleam/erlang/process import gleam/option.{None} @@ -41,7 +41,7 @@ pub fn it_echoes_messages_test() { let client = tcp_client.connect() let assert Ok(_) = - tcp.send(client, bit_builder.from_bit_string(<<"hi mom":utf8>>)) + tcp.send(client, bytes_builder.from_bit_array(<<"hi mom":utf8>>)) let assert Ok(Response(resp)) = process.receive(client_subject, 200) should.equal(resp, <<"hi mom":utf8>>) @@ -55,7 +55,7 @@ pub fn it_accepts_from_the_pool_test() { fn(msg, state, conn) { let assert Packet(msg) = msg let assert Ok(_) = - tcp.send(conn.socket, bit_builder.from_bit_string(msg)) + tcp.send(conn.socket, bytes_builder.from_bit_array(msg)) actor.continue(state) }, ) @@ -72,7 +72,7 @@ pub fn it_accepts_from_the_pool_test() { ) let client = tcp_client.connect() let assert Ok(_) = - tcp.send(client, bit_builder.from_bit_string(<<"hi mom":utf8>>)) + tcp.send(client, bytes_builder.from_bit_array(<<"hi mom":utf8>>)) let assert Ok(#(_tcp, _port, msg)) = process.select(client_selector, 200) process.send(client_sender, msg)