Home

Awesome

Erlang Utility Modules

build

Author Serge Aleynikov <serge(at)gmail.com>

Installation

{deps,
 [% ...
  {util, "~> 1.0"}
 ]}.

Content

ModuleDescription
decompilerdecompiles modules and functions (useful for verifying accuracy of code generation)
csvCSV parsing and loading data to MySQL
envenvironment variables substitution, path normalization
file_log_readerPeriodically read an append-only log file and parse newly added data
iifTernery if function including iif/3, iif/4, ife/3, ife/4 parse transforms
io_lib_pretty_limitedPrint term to binary by constraining the output size
ginConvenient parse transform for in(Value, [A,B,C]) type of guards
hexHex to bin conversion
listxMiscelaneous list handling functions
osxExecution of os commands with returned stdout and exit status
pcapreader/writer of packet capture files (tcpdump, wireshark)
restrict_remsh_modto be used for remote shells to restrict q(), init:stop(), erlang:halt(), etc.
smtpSMTP client supporting tcp and ssl protocols
sntpsimple SNTP client
strstringification functions including str/1 and str/2 parse transforms
stringxmiscelaneous string functions
throttleimplements a rate limitting algorithm
user_defaultextending shell with useful debugging and profiling commands
build-aux/md-to-edoc.awkAWK script for converting README.md files to overview.edoc

Additionally, the following Elixir modules are included:

ModuleFileDescription
CompileTimecompile_time.exEvaluate lambdas at compile time

Documentation

This project implements an extension of EDoc documentation by using the color scheme similar to GitHub, and generate the overview.edoc from the README.md.

In order to use this feature, modify your Makefile to include:

-include build-aux/docs-addon.mk

build-aux/docs-addon.mk:
	@echo "Fetching build-aux/docs-addon.mk" && \
		mkdir -p build-aux && \
		curl -s -o build-aux/docs-addon.mk https://raw.githubusercontent.com/saleyn/util/master/build-aux/docs-addon.mk

Also in your rebar.config add:

{edoc_opts, [{overview,        "build-aux/overview.edoc"},
             {stylesheet_file, "build-aux/edoc.css"},
             {title,           "Project title used by rebar and also inserted as title to the index.html"},
             {keywords,        "HTML meta keywords (comma-delimited) for search engine crawlers"}, 
             ...]}.

NOTE: the keywords option is not specific to EDoc but used by the HTML reformatting make file docs-addon.mk.

This will add the following targets to your Makefile:

Elixir

To add functions from user_default.erl to Elixir's iex shell, add ~/.iex.exs file containing:

import :user_default

Download