From 945f4436e5422e23cebe15575f3f79f77ac8d6c1 Mon Sep 17 00:00:00 2001 From: akash-akya Date: Sat, 2 Dec 2023 22:07:19 +0530 Subject: [PATCH 1/2] Update docs --- DEVELOPMENT.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 032a79f..c81a832 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,12 +4,14 @@ * Bump version and push to master branch -* Create new release at: https://github.com/akash-akya/vix/releases. +* Create new release at: https://github.com/akash-akya/vix/releases Github Actions and TravisCI creates pre-compiled NIF artifacts and push to the release. Wait for all the release to be available. Ensure artifacts are created for all Beam NIF versions, like `2.16`, `2.17` -* On local machine, remove existing pre-built NIF, cache and checksum `rm -rf cache/ priv/* checksum.exs` +* Ensure all pre-built NIF packages are created + +* On local machine, remove existing pre-built NIF packages, cache and checksum `rm -rf cache/ priv/* checksum.exs` * Remove existing compiled files `rm -rf _build/*/lib/vix` From 14dba50bee0290003634becf89c0b6b5b193fb9b Mon Sep 17 00:00:00 2001 From: akash-akya Date: Sat, 2 Dec 2023 22:07:56 +0530 Subject: [PATCH 2/2] Do not use reserved word as variable name --- lib/vix/vips/operation.ex | 1 + lib/vix/vips/operation_helper.ex | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/vix/vips/operation.ex b/lib/vix/vips/operation.ex index 137ac78..e5121a7 100644 --- a/lib/vix/vips/operation.ex +++ b/lib/vix/vips/operation.ex @@ -39,6 +39,7 @@ defmodule Vix.Vips.Operation do } = spec = operation_args_spec(name) func_name = function_name(name) + in_req_spec = normalize_input_variable_names(in_req_spec) req_params = Enum.map(in_req_spec, fn param -> diff --git a/lib/vix/vips/operation_helper.ex b/lib/vix/vips/operation_helper.ex index cbb4fa5..887d7c7 100644 --- a/lib/vix/vips/operation_helper.ex +++ b/lib/vix/vips/operation_helper.ex @@ -147,6 +147,16 @@ defmodule Vix.Vips.OperationHelper do def function_name(name), do: to_string(name) |> String.downcase() |> String.to_atom() + def normalize_input_variable_names(specs) do + Enum.map(specs, fn + %{param_name: "in"} = param -> + %{param | param_name: "input"} + + param -> + param + end) + end + def atom_typespec_ast(list) do Enum.reduce(list, &{:|, [], [&1, &2]}) end