floorplan v0.0.1 Floorplan.Utilities

Assorted helper functions

Summary

Functions

Generate a url-friendly string from component strings

Takes a filename and gzips it, returning the new filename

Helper for returning current time as a string

Takes a string and returns a url-safe parameterized string

Returns true unless input is whitespace-string, empty-string, or nil

Functions

build_uri(components)

Generate a url-friendly string from component strings

Examples

iex> Floorplan.Utilities.build_uri ["FOO", "bar@ 42"] “/foo/bar-42”

compress(filename)

Takes a filename and gzips it, returning the new filename

compress(filename, compressed_filename)
current_time()

Helper for returning current time as a string

parameterize(input_str, sep \\ "-")

Takes a string and returns a url-safe parameterized string

Examples

iex> Floorplan.Utilities.parameterize(“A_bIg-@-ole’$%$Safe-string-**-“) “a_big-ole-safe-string”

present?(input_str)

Returns true unless input is whitespace-string, empty-string, or nil

Examples

iex> Floorplan.Utilities.present?(“ “) false iex> Floorplan.Utilities.present?(“ a “) true iex> Floorplan.Utilities.present?(“ “) false iex> Floorplan.Utilities.present?(nil) false