Git Product home page Git Product logo

hexate's People

Contributors

cgorshing avatar mkb avatar pma avatar rjsamson avatar suranyami avatar sztheory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hexate's Issues

Possible namespace clash with Hex.pm?

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:

  • Something weird is going on between the Hex.pm package manager and this hex library.
  • Running tests seems to clobber the hex library and replace it with hex.pm.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.