Module: DnsMadeEasy::CLI::MessageHelpers
- Defined in:
- lib/dnsmadeeasy/cli/message_helpers.rb
Overview
Convenience helpers for colorful boxed CLI status messages.
Constant Summary collapse
- BOX_OPTIONS =
{ border: { type: :thick }, width: 85 }.freeze
Class Attribute Summary collapse
-
.stderr ⇒ Object
Returns the value of attribute stderr.
-
.stdout ⇒ Object
Returns the value of attribute stdout.
Class Method Summary collapse
Class Attribute Details
.stderr ⇒ Object
Returns the value of attribute stderr.
15 16 17 |
# File 'lib/dnsmadeeasy/cli/message_helpers.rb', line 15 def stderr @stderr end |
.stdout ⇒ Object
Returns the value of attribute stdout.
15 16 17 |
# File 'lib/dnsmadeeasy/cli/message_helpers.rb', line 15 def stdout @stdout end |
Class Method Details
.error(message) ⇒ Object
26 27 28 |
# File 'lib/dnsmadeeasy/cli/message_helpers.rb', line 26 def error() print_to(stderr, TTY::Box.error(, **BOX_OPTIONS)) end |
.info(message) ⇒ Object
18 19 20 |
# File 'lib/dnsmadeeasy/cli/message_helpers.rb', line 18 def info() print_to(stdout, TTY::Box.info(, **BOX_OPTIONS)) end |
.success(message) ⇒ Object
30 31 32 |
# File 'lib/dnsmadeeasy/cli/message_helpers.rb', line 30 def success() print_to(stdout, TTY::Box.success(, **BOX_OPTIONS)) end |
.warn(message) ⇒ Object
22 23 24 |
# File 'lib/dnsmadeeasy/cli/message_helpers.rb', line 22 def warn() print_to(stderr, TTY::Box.warn(, **BOX_OPTIONS)) end |