sshex v2.2.0 SSHEx.Helpers

require SSHEx.Helpers, as: H # the cool way

Summary

Functions

Apply given defaults to given Keyword. Returns merged Keyword

Convenience to get environment bits. Avoid all that repetitive Application.get_env( :myapp, :blah, :blah) noise

Macros

Spit to output any passed variable, with location information

Print to stdout a TODO message, with location information

Functions

convert_value(v)
convert_values(args)
defaults(args, defs)

Apply given defaults to given Keyword. Returns merged Keyword.

The inverse of Keyword.merge, best suited to apply some defaults in a chainable way.

Ex:

kw = gather_data
  |> transform_data
  |> H.defaults(k1: 1234, k2: 5768)
  |> here_i_need_defaults

Instead of:

kw1 = gather_data
  |> transform_data
kw = [k1: 1234, k2: 5768]
  |> Keyword.merge(kw1)
  |> here_i_need_defaults
env(key, default \\ nil)

Convenience to get environment bits. Avoid all that repetitive Application.get_env( :myapp, :blah, :blah) noise.

env(app, key, default)

Macros

spit(obj \\ "", inspect_opts \\ [])

Spit to output any passed variable, with location information.

todo(msg \\ "")

Print to stdout a TODO message, with location information.