From 35f940374f90ec505f0119167be34c807981687a Mon Sep 17 00:00:00 2001 From: STEVAN Antoine <antoine.stevan@isae-supaero.fr> Date: Fri, 5 Jul 2024 15:33:32 +0000 Subject: [PATCH] bump to Nushell 0.95.0 (dragoon/komodo!149) see the changelogs of - [Nushell `0.94.0`](https://www.nushell.sh/blog/2024-05-28-nushell_0_94_0.html) - [Nushell `0.94.1`](https://www.nushell.sh/blog/2024-05-30-nushell_0_94_1.html) - [Nushell `0.94.2`](https://www.nushell.sh/blog/2024-06-03-nushell_0_94_2.html) i also removed the `bytes encode` and `bytes decode` commands from `.nushell/binary.nu` because... well they did not work anymore and they were not used anywhere :eyes: --- .gitlab-ci.yml | 2 +- .nushell/binary.nu | 13 ------------- README.md | 2 +- komodo.nu | 2 +- tests/binary.nu | 8 +------- 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25b7762d..8377911e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: variables: NUSHELL_ARCH: "x86_64-unknown-linux-musl" - NUSHELL_VERSION: "0.93.0" + NUSHELL_VERSION: "0.95.0" workflow: rules: diff --git a/.nushell/binary.nu b/.nushell/binary.nu index 0fb28ee6..2f30ec71 100644 --- a/.nushell/binary.nu +++ b/.nushell/binary.nu @@ -1,16 +1,3 @@ -# decode a list of integer bytes into the underlying encoded string -export def "bytes decode" [encoding: string = "utf-8"]: list<int> -> string { - each { into binary | bytes at 0..1 } | bytes collect | decode $encoding -} - -# encode an encoded string into the underlying list of integer bytes -export def "bytes encode" [encoding: string = "utf-8"]: string -> list<int> { - let bytes = $in | encode $encoding - seq 1 ($bytes | bytes length) | each {|i| - $bytes | bytes at ($i - 1)..($i) | into int - } -} - export def "bytes from_int" []: [int -> binary, list<int> -> binary] { each { into binary --compact } | bytes collect } diff --git a/README.md b/README.md index 35f4be8d..cbbd5afb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ below is an example of how to use the binary application with Nushell: ``` > **Note** -> requires Nushell 0.93.0 or later +> requires Nushell 0.95.0 or later tests for the binary application can also be run with ```bash diff --git a/komodo.nu b/komodo.nu index 38b51c1a..c23b7929 100644 --- a/komodo.nu +++ b/komodo.nu @@ -150,7 +150,7 @@ export def "komodo prove" [ } let type = $fec_params | describe --detailed | update columns { sort } - let expected = { type: record, lazy: false, columns: { k: int, n: int } } + let expected = { type: record, columns: { k: int, n: int } } if $type != $expected { error make { msg: $"(ansi red_bold)invalid `--fec-params`(ansi reset)", diff --git a/tests/binary.nu b/tests/binary.nu index 1cb755f6..21a5a736 100644 --- a/tests/binary.nu +++ b/tests/binary.nu @@ -1,6 +1,4 @@ -use ../.nushell binary [ - "bytes decode", "bytes encode", "bytes from_int", "bytes to_int" -] +use ../.nushell binary [ "bytes from_int", "bytes to_int" ] use std assert @@ -18,8 +16,4 @@ def main [] { let bytes = random-bytes 1_000 assert equal ($bytes | bytes from_int | bytes to_int) $bytes - - const input = "hello world!" - assert equal ($input | bytes encode) $hello_world_int - assert equal ($input | bytes encode | bytes decode) $input } -- GitLab