From 1f404fc2cc9d1942cf4d826c5a7ea76fe3fd4f48 Mon Sep 17 00:00:00 2001 From: Adrian Kumpf Date: Sun, 6 Jan 2019 15:43:22 +0100 Subject: [PATCH] Update abacom-relay-board to v0.3.0 --- .dockerignore | 2 +- Dockerfile | 4 ++-- README.md | 8 ++++---- mix.lock | 10 +++++----- native/arb/Cargo.lock | 29 +++++++++++++++-------------- native/arb/Cargo.toml | 2 +- native/arb/src/lib.rs | 6 +++--- test/arb_test.exs | 6 +----- 8 files changed, 32 insertions(+), 35 deletions(-) diff --git a/.dockerignore b/.dockerignore index fffc71c..0f58eeb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,8 +2,8 @@ .git/ .gitignore Dockerfile -Dockerfile README.md _build/ deps/ test/ +native/arb/target/ diff --git a/Dockerfile b/Dockerfile index ac7702b..b5d2c16 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM erlang:20.3 -ENV ELIXIR_VERSION="v1.6.5" \ - RUST_VERSION="1.26.0" \ +ENV ELIXIR_VERSION="v1.7.4" \ + RUST_VERSION="1.31.0" \ LANG="C.UTF-8" \ MIX_ENV="prod" \ HOME=/opt/app diff --git a/README.md b/README.md index 836a615..356c7c7 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ An Elixir NIF for controlling the ABACOM CH341A relay board ### Requirements -In order to compile a recent version of `rust` (stable) must be installed. -Also, the native [libusb](https://github.com/libusb/libusb) library is required -(e.g `libusb-1.0-0-dev` on Debian-based distributions). +In order to compile a recent version of `rust` (stable; 2018 edition) must be +installed. Also, the native [libusb](https://github.com/libusb/libusb) library +is required (e.g `libusb-1.0-0-dev` on Debian-based distributions). ### Installation @@ -18,7 +18,7 @@ Add `:arb` to your list of dependencies: ```elixir def deps do [ - {:arb, "~> 0.2"} + {:arb, "~> 0.3"} ] end ``` diff --git a/mix.lock b/mix.lock index c97461a..f1e23b4 100644 --- a/mix.lock +++ b/mix.lock @@ -1,8 +1,8 @@ %{ - "earmark": {:hex, :earmark, "1.3.0", "17f0c38eaafb4800f746b457313af4b2442a8c2405b49c645768680f900be603", [:mix], [], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.19.1", "519bb9c19526ca51d326c060cb1778d4a9056b190086a8c6c115828eaccea6cf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.7", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup": {:hex, :makeup, "0.5.5", "9e08dfc45280c5684d771ad58159f718a7b5788596099bdfb0284597d368a882", [:mix], [{:nimble_parsec, "~> 0.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.10.0", "0f09c2ddf352887a956d84f8f7e702111122ca32fbbc84c2f0569b8b65cbf7fa", [:mix], [{:makeup, "~> 0.5.5", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.4.0", "ee261bb53214943679422be70f1658fff573c5d0b0a1ecd0f18738944f818efe", [:mix], [], "hexpm"}, + "earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"}, + "ex_doc": {:hex, :ex_doc, "0.19.2", "6f4081ccd9ed081b6dc0bd5af97a41e87f5554de469e7d76025fba535180565f", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, + "makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, + "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, "rustler": {:hex, :rustler, "0.18.0", "db4bd0c613d83a1badc31be90ddada6f9821de29e4afd15c53a5da61882e4f2d", [:mix], [], "hexpm"}, } diff --git a/native/arb/Cargo.lock b/native/arb/Cargo.lock index f659133..4f092d0 100644 --- a/native/arb/Cargo.lock +++ b/native/arb/Cargo.lock @@ -2,7 +2,7 @@ name = "arb" version = "0.1.0" dependencies = [ - "arb 0.2.2 (git+https://github.com/adriankumpf/abacom-relay-board?tag=v0.2.2)", + "arb 0.3.0 (git+https://github.com/adriankumpf/abacom-relay-board?tag=v0.3.0)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustler 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustler_codegen 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -10,9 +10,10 @@ dependencies = [ [[package]] name = "arb" -version = "0.2.2" -source = "git+https://github.com/adriankumpf/abacom-relay-board?tag=v0.2.2#fffd7204b6c7b5923f717b5d4c8b1a8e9ffa0bea" +version = "0.3.0" +source = "git+https://github.com/adriankumpf/abacom-relay-board?tag=v0.3.0#544720e0df6bf56f764ed5fc4b698daff09e0b2a" dependencies = [ + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libusb 0.3.0 (git+https://github.com/adriankumpf/libusb-rs?branch=dev)", ] @@ -39,7 +40,7 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -52,7 +53,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.43" +version = "0.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -61,7 +62,7 @@ version = "0.3.0" source = "git+https://github.com/adriankumpf/libusb-rs?branch=dev#19d26c44eebd4a8d4a9332bca2c00ca83c75fb6c" dependencies = [ "bit-set 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", "libusb-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -70,13 +71,13 @@ name = "libusb-sys" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -98,7 +99,7 @@ name = "rustler_codegen" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -145,16 +146,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum arb 0.2.2 (git+https://github.com/adriankumpf/abacom-relay-board?tag=v0.2.2)" = "" +"checksum arb 0.3.0 (git+https://github.com/adriankumpf/abacom-relay-board?tag=v0.3.0)" = "" "checksum bit-set 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6e1e6fb1c9e3d6fcdec57216a74eaa03e41f52a22f13a16438251d8e88b89da" "checksum bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440d5cb623bb7390ae27fec0bb6c61111969860f8e3ae198bfa0663645e67cf" "checksum erlang_nif-sys 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9bc72dbc2c220693a2a009ec97705c144ea5cc5db703df43feb903663c999536" -"checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82" +"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" -"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)" = "023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd" "checksum libusb 0.3.0 (git+https://github.com/adriankumpf/libusb-rs?branch=dev)" = "" "checksum libusb-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4c53b6582563d64ad3e692f54ef95239c3ea8069e82c9eb70ca948869a7ad767" -"checksum pkg-config 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "104630aa1c83213cbc76db0703630fcb0421dac3585063be4ce9a8a2feeaa745" +"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum rustler 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "56c8f41f12f189bea1d04f188834f62ab58da6126f76edb67d2ef90070c469b2" "checksum rustler_codegen 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf38a981e9ae5f9d7b326e4ebadcf51fb439a88173de75671ee8b97c8e5eb713" diff --git a/native/arb/Cargo.toml b/native/arb/Cargo.toml index 75e3e7c..0bc4e0b 100644 --- a/native/arb/Cargo.toml +++ b/native/arb/Cargo.toml @@ -13,4 +13,4 @@ crate-type = ["dylib"] rustler = "0.18.0" rustler_codegen = "0.18.0" lazy_static = "1.2.0" -arb = { git = "https://github.com/adriankumpf/abacom-relay-board", tag = 'v0.2.2' } +arb = { git = "https://github.com/adriankumpf/abacom-relay-board", tag = 'v0.3.0' } diff --git a/native/arb/src/lib.rs b/native/arb/src/lib.rs index 3498142..8d8b999 100644 --- a/native/arb/src/lib.rs +++ b/native/arb/src/lib.rs @@ -21,6 +21,7 @@ mod atoms { atom unsafe_read; atom bad_device; atom usb; + atom io; } } @@ -40,9 +41,8 @@ fn arb_error_to_term<'a>(env: Env<'a>, err: arb::Error) -> Term<'a> { Error::VerificationFailed => atoms::verification_failed().encode(env), Error::UnsafeRead => atoms::unsafe_read().encode(env), Error::BadDevice => atoms::bad_device().encode(env), - Error::Usb(libusb_error) => { - (atoms::usb(), format!("{}", libusb_error).encode(env)).encode(env) - } + Error::Usb(usb_error) => (atoms::usb(), format!("{}", usb_error).encode(env)).encode(env), + Error::IO(io_error) => (atoms::io(), format!("{}", io_error).encode(env)).encode(env), }; (atoms::error(), error).encode(env) diff --git a/test/arb_test.exs b/test/arb_test.exs index 6fd1f75..f6d852e 100644 --- a/test/arb_test.exs +++ b/test/arb_test.exs @@ -1,8 +1,4 @@ defmodule ArbTest do use ExUnit.Case - doctest Arb - - # test "greets the world" do - # assert Arb.hello() == :world - # end + # doctest Arb end