Skip to content

Commit

Permalink
Update abacom-relay-board to v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adriankumpf committed Jan 6, 2019
1 parent 17e8d46 commit 1f404fc
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.git/
.gitignore
Dockerfile
Dockerfile
README.md
_build/
deps/
test/
native/arb/target/
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -18,7 +18,7 @@ Add `:arb` to your list of dependencies:
```elixir
def deps do
[
{:arb, "~> 0.2"}
{:arb, "~> 0.3"}
]
end
```
Expand Down
10 changes: 5 additions & 5 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -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"},
}
29 changes: 15 additions & 14 deletions native/arb/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/arb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
6 changes: 3 additions & 3 deletions native/arb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod atoms {
atom unsafe_read;
atom bad_device;
atom usb;
atom io;
}
}

Expand All @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions test/arb_test.exs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1f404fc

Please sign in to comment.