View Source ExAequo.Path (ExAequo v0.5.0)

Extending Elixir's Path module with some useful functions

Link to this section Summary

Functions

iex(0)> basename_without_ext("a/b/c.txt")
"c"

iex(1)> basename_without_ext("a/b/c.txt.eex")
"c.txt"

iex(2)> basename_without_ext("a/b/c")
"c"
iex(3)> fullname_without_ext("a/b/c.txt")
"a/b/c"

iex(4)> fullname_without_ext("a/b/c.txt.eex")
"a/b/c.txt"

iex(5)> fullname_without_ext("a/b/c")
"a/b/c"

iex(6)> fullname_without_ext("/c")
"/c"

Link to this section Types

@type date_tuple() ::
  {non_neg_integer(), 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12, 1..255}
@type lstat_result() :: {:ok, File.Stat.t()} | {:error, File.posix()}
@type param_type() :: Keyword.t() | map()
@type params_t() :: map() | Keyword.t()

Link to this section Functions

Link to this function

basename_without_ext(filename)

View Source
@spec basename_without_ext(String.t()) :: String.t()
iex(0)> basename_without_ext("a/b/c.txt")
"c"

iex(1)> basename_without_ext("a/b/c.txt.eex")
"c.txt"

iex(2)> basename_without_ext("a/b/c")
"c"
Link to this function

fullname_without_ext(filename)

View Source
@spec fullname_without_ext(String.t()) :: String.t()
iex(3)> fullname_without_ext("a/b/c.txt")
"a/b/c"

iex(4)> fullname_without_ext("a/b/c.txt.eex")
"a/b/c.txt"

iex(5)> fullname_without_ext("a/b/c")
"a/b/c"

iex(6)> fullname_without_ext("/c")
"/c"