FAQ Database Discussion Community


Should I use Mix.Utils in my elixir code?

elixir,mix
I need to get a file by URL and store it on the local disk. I see that Mix.Utils has: copy_path!(source, target, opts \\ []) Which seems to do exactly what I want, but is Mix.Utils only something you'd use for writing mix tasks and not for general problem solving?...

Multiple types in a single c++ vector

c++,vector,mix
I wonder if i could store different types of non-native data into a single vector? it goes like this: class foo { private: int x; public: foo(int a=0):x(a){} int getx() { return x; } void setx(int a=0) { x=a; } }; class var:public foo { private: int y; public: var(int...

Loading mix dependencies marked as test only when the MIX_ENV was not originally set to “test”

elixir,mix
I wish to programmatically run the mix test task within my Elixir application. This can be done with Mix.Tasks.Test.run/1, though attempting to do so without first setting the MIX_ENV environmental variable results in the task refusing to run. We can set the env with System.put_env/2, but then the application will...

Importing test code in elixir unit test

elixir,mix
I'm writing tests of some Elixir code that interacts with SSH. In my tests, I'd like to start an SSH server that I can run my code against. I'd prefer to store this code in it's own file in the test directory, and have it imported by various different tests....