Class Simp::Cli::Config::Item
In: lib/simp/cli/config/items/item.rb
Parent: Object

Methods

Included Modules

Simp::Cli::Config::Logging

Constants

PAUSE_SECONDS = 2

Attributes

allow_user_apply  [RW] 
applied_detail  [RW] 
applied_status  [RW] 
applied_time  [RW] 
config_items  [RW] 
data_type  [RW]  an important logged message to be highlighted on the screen
description  [RW]  an important logged message to be highlighted on the screen
die_on_apply_fail  [RW] 
fact  [RW]  an important logged message to be highlighted on the screen
fail_on_missing_answer  [RW] 
key  [RW]  an important logged message to be highlighted on the screen
next_items_tree  [RW] 
puppet_apply_cmd  [R] 
silent  [RW] 
skip_apply  [RW] 
skip_apply_reason  [RW] 
skip_query  [RW] 
skip_yaml  [RW] 
start_time  [RW] 
value  [RW]  an important logged message to be highlighted on the screen

Public Class methods

Public Instance methods

summary of outcome of apply

logging helper methods

returns the default answer to Item#query

returns the default answer to Item for noninteractive operations

Execute a command in a child process, log failure and return whether command succeeded. When ignore_failure is true and command fails, does not log failure and returns true

Retrieve the Item with the specified key from @config_items Hash Raises MissingItemError if Item does not exist in @config_items

A helper method that highline can use to cast String answers to the ask in query(). nil means don‘t cast, Date casts into a date, etc. A lambda can be used for sanitization.

Descendants of Item are very likely to override this method.

optional message to show users when invalid input is entered

value of item as read from OS (via Facter)

pause log output to allow message of message_level to be viewed on the console


 Pretty stdout/stdin methods

print a pretty banner to describe an item

print a pretty summary of the Item‘s key+value, printed to stdout

choose @value of Item

ask an interactive question (via stdout/stdin)

prompt to use for query

value of Item as recommended by Very Clever Logic (tm)

Display an ASCII, spinning progress spinner for the action in a block and return the result of that block Example,

   result = show_wait_spinner {
     execute('createrepo -q -p --update .')
   }

Lifted from stackoverflow.com/questions/10262235/printing-an-ascii-spinning-cursor-in-the-console

String in yaml answer file format, with comments (if any)

returns true if x is a valid value

Verify Item with the specified key exists in @config_items Hash Raises MissingItemError if Item does not exist in @config_items

[Validate]