PassiveSupport.Path.Sigil (passive_support v0.8.2)

Quickly and idiomatically build filesystem paths by using ~P

The path sigil

import PassiveSupport.Path.Sigil will make ~P activate various functions within the Path module, for quick and idiomatic usage of filesystem paths. As its default behavior, ~P[path/to/something] will expand to the output of Path.absname("path/to/something"), but other behaviors can be exposed depending on the modifier provided following the closing delimiter. The enabled modifiers are currently:

Beyond that, there is no means of modifying function behavior any further, and interpolation through ~p is not yet implemented. They both are on the roadmap for this module, but being that this maintainer fundamentally works on this library in his spare time, the ready date for those functionalities is decidedly TBD.


iex> ~P[foo]

iex> ~P[bar]a

iex> ~P[bat]b
iex> ~P[bat/boy]b

iex> ~P[fizz/buzz]d
iex> ~P[/etc/hosts]d
iex> ~P[/etc/config.d/nginx.conf]d

iex> ~P[./deps/phoenix/lib]x
iex> ~P[~/.bash_profile]x

iex> ~P[**/*.txt]w

Link to this section Summary

Link to this section Functions

Link to this macro

sigil_P(path, modifiers)