Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A tiny assistant for CUI operations.
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
lib/io
test
History.rdoc
LICENSE
Manifest.txt
README.rdoc
Rakefile

README.rdoc

IO::Nosey

Description

A tiny driving assistant with daily console scripting.

Features

  • Pure Ruby :)

Usage

  • setup

    require 'io/nosey'
    
    include IO::Nosey
  • with input validation

    ask "What's your name?", input: /\A\w+ \w+\z/
  • with default value

    ask "What's your favorite?", default: 'ruby'
  • handle return value

    last_name, family_name = ask "What's your name?", input: /\A\w+ \w+\z/, parse: ->s{s.split}
    
    ask 'How old are you?', input: /\A(\d+)\z/, parse: ->s{Integer s}, return: 10..100
  • yes or no

    agree? 'Do you like this API?'
  • get password

    ask "What's your password?", echo: false
  • choose one

    choose 'Which Five do you like?', 5 => 'Integer', 'five' => 'String', :FIVE => 'Symbol'

Requirements

  • Ruby 1.9.3 or later

    target released versions

    • 1.9.3-p125

  • validation-0.0.3

Installation

  • gem install io-nosey

License

Copyright © 2011 Kenichi Kamiya

The MIT License (See the file LICENSE)

Something went wrong with that request. Please try again.