ExAequo.Path (ExAequo v0.2.2) View Source

Extending Elixir's Path module with some useful functions

Link to this section Summary

Functions

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

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

    iex(2)> base_name_without_ext("a/b/c")
    "c"
    iex(3)> full_name_without_ext("a/b/c.txt")
    "a/b/c"

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

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

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

Link to this section Types

Specs

date_tuple() ::
  {non_neg_integer(), 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12, 1..255}

Specs

lstat_result() :: {:ok, File.Stat.t()} | {:error, File.posix()}

Specs

param_type() :: Keyword.t() | map()

Specs

params_t() :: map() | Keyword.t()

Link to this section Functions

Link to this function

base_name_without_ext(filename)

View Source

Specs

base_name_without_ext(String.t()) :: String.t()
    iex(0)> base_name_without_ext("a/b/c.txt")
    "c"

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

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

full_name_without_ext(filename)

View Source

Specs

full_name_without_ext(String.t()) :: String.t()
    iex(3)> full_name_without_ext("a/b/c.txt")
    "a/b/c"

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

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

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