rjsamson / hexate Goto Github PK
View Code? Open in Web Editor NEWA simple module for Hex encoding / decoding in Elixir.
License: MIT License
A simple module for Hex encoding / decoding in Elixir.
License: MIT License
It'd be nice if we could add this in deps as a hex package instead of having to specify git as the source.
I've been getting some very strange behaviour trying to use this package in my color library suranyami/cor.
Here are 2 consecutive runs of mix test
with nothing else happening in between:
> mix test
lib/hex.ex:1: warning: redefining module Hex
==> hex
Compiled lib/hex.ex
Generated hex.app
==> cor
Compiled lib/cor.ex
lib/cor/rgb.ex:2: warning: unused import Hex
Compiled lib/cor/rgb.ex
Generated cor.app
1) test html (Cor.RgbTest)
test/rgb_test.exs:24
Assertion with == failed
code: Rgb.html(Rgb.red()) == "ff0000"
lhs: "#ff0000"
rhs: "ff0000"
stacktrace:
test/rgb_test.exs:25
Finished in 0.07 seconds (0.07s on load, 0.00s on tests)
5 tests, 1 failures
Randomized with seed 840680
> mix test
1) test html (Cor.RgbTest)
test/rgb_test.exs:24
** (UndefinedFunctionError) undefined function: Hex.encode/2
stacktrace:
Hex.encode(255.0, 2)
(cor) lib/cor/rgb.ex:18: Cor.Rgb.html/1
test/rgb_test.exs:25
2) test hex_digits (Cor.RgbTest)
test/rgb_test.exs:19
** (UndefinedFunctionError) undefined function: Hex.encode/2
stacktrace:
Hex.encode(255.0, 2)
test/rgb_test.exs:20
Finished in 0.08 seconds (0.08s on load, 0.00s on tests)
5 tests, 2 failures
When I run iex -S mix
and run Hex.encode(255.0, 2)
in my lib's directory, I get UndefinedFunctionError.
When I run iex -S mix
in the hex directory, it works as expected.
On a whim, I added a version
function that returned "XXX" directly into deps/hex/lib/hex.ex
file locally in my repo. Recompiled, ran iex -S mix
:
iex> Hex.version
"XXX"
I then re-ran mix test
, got the above errors, then ran iex -S mix
for a SECOND TIME, and this is what I get:
iex> Hex.version
"0.4.2"
Which just so happens to be the same as Hex.pm version, as shown by:
> mix hex.info
Hex v0.4.2
Registry file available (last updated: 2014-09-27 08:31:03)
Size: 125kB
Packages #: 199
Versions #: 799
So, in summary:
I'm going to temporarily rename my fork to hexate
, and see if this voodoo all goes away. If it does, it might be an idea to rename this?
Either that, or dig deeper into what exactly is going on here.
This certainly raises some questions about namespaces in Elixir, too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.