README.md in cliutils-1.2.7 vs README.md in cliutils-1.2.8

- old
+ new

@@ -52,23 +52,23 @@ # Libraries CLIUtils offers: * [PrettyIO](#prettyio): nicer-looking CLI messages -* [Messenging](#messenging): a system to display nicely-formatted messages to one or more tagets +* [Messaging](#messaging): a system to display nicely-formatted messages to one or more tagets * [Configuration](#configuration): a app configuration manager * [Prefs](#prefs): a preferences prompter and manager ## PrettyIO -First stop on our journey is better client IO. To activate, simply mix into your project: +First stop on our journey is better client IO via `PrettyIO`. To activate, simply mix into your project: ```ruby include CLIUtils::PrettyIO ``` -PrettyIO affords you colorized strings: +To start, `PrettyIO` affords you colorized strings: ```ruby puts 'A sample string'.red ``` ![alt text](https://raw.githubusercontent.com/bachya/cli-utils/master/res/readme-images/prettyio-red-text.png "Colored Text via PrettyIO") @@ -90,33 +90,33 @@ ```ruby puts 'A sample string'.colorize('35;42') ``` ![alt text](https://raw.githubusercontent.com/bachya/cli-utils/master/res/readme-images/prettyio-gnarly-text.png "Complex Colored Text via PrettyIO") -Naturally, memorizing the ANSI color scheme is a pain, so PrettyIO gives you a convenient method to look up these color combinations: +Naturally, memorizing the ANSI color scheme is a pain, so `PrettyIO` gives you a convenient method to look up these color combinations: ```ruby color_chart ``` ![alt text](https://raw.githubusercontent.com/bachya/cli-utils/master/res/readme-images/prettyio-color-chart.png "PrettyIO Color Chart") -## Messenging +## Messaging -Throughout the life of your application, you will most likely want to send several messages to your user (warnings, errors, info, etc.). Messenging makes this a snap. It, too, is a mixin: +Throughout the life of your application, you will most likely want to send several messages to your user (warnings, errors, info, etc.). `Messaging` makes this a snap. It, too, is a mixin: ```ruby -include CLIUtils::Messenging +include CLIUtils::Messaging ``` -Once mixed in, you get access to `messenger`, a type of Logger that uses PrettyIO to send nicely-formatted messages to your user. For example, if you'd like to warn your user: +Once mixed in, you get access to `messenger`, a type of Logger that uses `PrettyIO` to send nicely-formatted messages to your user. For example, if you'd like to warn your user: ```ruby messenger.warn('Hey pal, you need to be careful.') ``` ![alt text](https://raw.githubusercontent.com/bachya/cli-utils/master/res/readme-images/messenger-warn.png "A Warning from Messenger") -### Messenging Methods +### Messaging Methods `messenger` gives you access to several basic methods: * `messenger.error`: used to show a formatted-red error message. * `messenger.info`: used to show a formatted-blue infomational message. @@ -143,11 +143,11 @@ `messenger` outputs 'Starting up...', runs the code in `# do stuff here`, and once complete, outputs 'Done!' on the same line. Note that `section_block` is the same exact signature (except for the method name, of course!). ### Message Wrapping -PrettyIO also gives `messenger` the ability to wrap your messages so that they don't span off into infinity. You can even control what the wrap limit (in characters) is: +`PrettyIO` also gives `messenger` the ability to wrap your messages so that they don't span off into infinity. You can even control what the wrap limit (in characters) is: ```Ruby CLIUtils::PrettyIO.wrap_char_limit = 50 messenger.info('This is a really long message, okay? It should wrap at some point. Seriously. Wrapping is nice.') puts '' @@ -167,15 +167,15 @@ p = messenger.prompt('Are you a fan of Battlestar Galactica?', default = 'Y') messenger.info("You answered: #{ p }") ``` ![alt text](https://raw.githubusercontent.com/bachya/cli-utils/master/res/readme-images/prompting.png "Prompting") -When you pass a default to `messenging.prompt`, hitting `Enter` (i.e., leaving the prompt blank) will return the value of the default. +When you pass a default to `messaging.prompt`, hitting `Enter` (i.e., leaving the prompt blank) will return the value of the default. ### Logging -Often, it's desirable to log messages as they appear to your user. `messenging` makes this a breeze by allowing you to attach and detach Logger instances at will. +Often, it's desirable to log messages as they appear to your user. `messaging` makes this a breeze by allowing you to attach and detach Logger instances at will. For instance, let's say you wanted to log a few messages to both your user's STDOUT and to `file.txt`: ```Ruby # By default, messenger only outputs to STDOUT. @@ -500,10 +500,9 @@ "But," you say, "I want to ensure that my user gives answers that conform to certain specifications!" Not a problem, dear user: `Prefs` gives you Validators. Currently supported Validators are: ```YAML validators: - - numeric # Must be a number - alphabetic # Must be made up of letters and spaces - alphanumeric # Must be made up of letters, numbers, and spaces - date # Must be a parsable date (e.g., 2014-04-03) - non_nil # Must be a non-nil value - numeric # Must be made up of numbers