Nicd

Nicd

I needed a way to get the GitHub colours for programming languages based on their name (as in the colours used in the bars that show how much of each language a project has) so I wrote a small library for it. You can find it at language_colours | Hex

I also wanted to learn how to structure a library to be configurable so it’s a bit overkill in that regard but should be simple to use. It has support for a fallback in case the language is not found, using the Rainbow package.

Actually currently I have an issue with the 1.0.0. It has a mix task that lets you download the colour data. This task uses httpc and thus it uses inets also. When compiling, it complains that the current project doesn’t have inets in the applications list. But it’s only used in this task so I don’t think it should be there at all. How should I get rid of this message?

Showing Posts 1 to 5

03juan

03juan

This Elixir v1.11 release note on Compiler checks: application boundaries should help.

Nicd

Nicd OP

Thanks, I’m aware of that. My issue is that the task is not part of the library code. I.e. the task will not be present when the code is compiled to a release, it is only there for development. Thus I don’t want to add :inets to extra_applications, which would presumably affect the deployed release.

I got advice from José to use the xref trick to suppress the warning. It’ll hide any warnings about :inets, but I guess I’ll have to live with that.

03juan

03juan

Fair enough, coming from José I guess that’s all one can do… Sorry for necroing the thread.

For what it’s worth I’ve learned some good things related to configuration and dependency injection from your code. Thank you.

Nicd

Nicd OP

There’s nothing to apologise for. :slight_smile: And thanks for your kind words.

This is my first proper library that has configuration, so don’t take it too much as gospel. :smiley: But I think it’s pretty good, though I like to use maps and structs instead of keyword lists in configuration and supervisor arguments, so that’s somewhat unusual in Elixir.

03juan

03juan

Yes, I did note of the map interface and I’m also partial to that; probably a remnant of my Ruby days.

Always good to see how others implement things even if it’s not necessarily “the done way”, can always learn something when I’m sitting in the butt-end of the world without personal mentors.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New

Other Trending Topics Top

mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
lawik
I was thinking since Goatmire Elixir turned out pretty good I should maybe do another one. 30th of Sep - 2nd of Oct this year./ The firs...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews