README.md in userinput-1.0.1 vs README.md in userinput-1.0.2
- old
+ new
@@ -1,11 +1,11 @@
userinput
=========
[![Gem Version](https://img.shields.io/gem/v/userinput.svg)](https://rubygems.org/gems/userinput)
[![Dependency Status](https://img.shields.io/gemnasium/akerl/userinput.svg)](https://gemnasium.com/akerl/userinput)
-[![Build Status](https://img.shields.io/circleci/project/akerl/userinput.svg)](https://circleci.com/gh/akerl/userinput)
+[![Build Status](https://img.shields.io/circleci/project/akerl/userinput/master.svg)](https://circleci.com/gh/akerl/userinput)
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/userinput.svg)](https://codecov.io/github/akerl/userinput)
[![Code Quality](https://img.shields.io/codacy/fbda4046154e4ac38a47f2c6627d57c8.svg)](https://www.codacy.com/app/akerl/userinput)
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
A simple user input library
@@ -37,11 +37,11 @@
> prompt.ask
? [_other]
=> "_other"
```
-If you provide a validation Regexp or a code block, the input will be validated using that:
+If you provide a validation Regexp, Enumerable, or a code block, the input will be validated using that:
```
> require 'userinput'
=> true
> prompt = UserInput.new(validation: /[0-9]+/)
@@ -93,9 +93,22 @@
> prompt = UserInput.new(message: 'Password', secret: true, fd: STDERR)
=> #<UserInput::Prompt:0x007f888110a138 @attempts=nil, @message="Password", @default=nil, @secret=true, @fd=#<IO:<STDERR>>, @validation=nil>
> prompt.ask
Password?
=> "_password"
+```
+
+### Boolean helper
+
+UserInput::Boolean is a subclass of Prompt that is designed for asking yes/no questions.
+
+It valiates that answers match /(y|yes|n|no)/i, and returns the response as a boolean true/false rather than a string.
+
+To use it:
+
+```
+a = UserInput::Boolean.new(message: 'Do you like cats')
+response = a.ask
```
## Installation
gem install userinput