Sha256: b93a0a9edcfe51a46c5597ac919e91acc797660dadcd48d01f7259211b2b14ab

Contents?: true

Size: 1.63 KB

Versions: 166

Compression:

Stored size: 1.63 KB

Contents

= Read Me

by James Edward Gray II

== Description

Welcome to HighLine.

HighLine was designed to ease the tedious tasks of doing console input and
output with low-level methods like gets() and puts().  HighLine provides a
robust system for requesting data from a user, without needing to code all the
error checking and validation rules and without needing to convert the typed
Strings into what your program really needs.  Just tell HighLine what you're
after, and let it do all the work.

== Documentation

See HighLine and HighLine::Question for documentation.

== Examples

Basic usage:

  ask("Company?  ") { |q| q.default = "none" }

Validation:

  ask("Age?  ", Integer) { |q| q.in = 0..105 }
  ask("Name?  (last, first)  ") { |q| q.validate = /\A\w+, ?\w+\Z/ }

Type conversion for answers:

  ask("Birthday?  ", Date)
  ask("Interests?  (comma sep list)  ", lambda { |str| str.split(/,\s*/) })

Reading passwords:

  ask("Enter your password:  ") { |q| q.echo = false }
  ask("Enter your password:  ") { |q| q.echo = "x" }

ERb based output (with HighLine's ANSI color tools):

  say("This should be <%= color('bold', BOLD) %>!")

Menus:

  choose do |menu|
    menu.prompt = "Please choose your favorite programming language?  "
  
    menu.choice(:ruby) { say("Good choice!") }
    menu.choices(:python, :perl) { say("Not from around here, are you?") }
  end
  
For more examples see the examples/ directory of this project.

== Installing

See the INSTALL file for instructions.

== Questions and/or Comments

Feel free to email {James Edward Gray II}[mailto:james@grayproductions.net] or
{Gregory Brown}[mailto:gregory.t.brown@gmail.com] with any questions.

Version data entries

166 entries across 153 versions & 17 rubygems

Version Path
delano-rye-0.6.2 vendor/highline-1.5.1/README
delano-rye-0.6.3 vendor/highline-1.5.1/README
delano-rye-0.6.4 vendor/highline-1.5.1/README
malysz87-highline-1.5.10 README
malysz87-highline-1.5.11 README
malysz87-highline-1.5.4 README
malysz87-highline-1.5.5 README
malysz87-highline-1.5.6 README
malysz87-highline-1.5.7 README
malysz87-highline-1.5.8 README
malysz87-highline-1.5.9 README
solutious-rudy-0.6.0 vendor/highline-1.5.1/README
solutious-rudy-0.6.1 vendor/highline-1.5.1/README
solutious-rudy-0.6.2 vendor/highline-1.5.1/README
solutious-rudy-0.6.3 vendor/highline-1.5.1/README
solutious-rudy-0.6.4 vendor/highline-1.5.1/README
solutious-rudy-0.6.5 vendor/highline-1.5.1/README
solutious-rudy-0.6.6 vendor/highline-1.5.1/README
solutious-rudy-0.6.7 vendor/highline-1.5.1/README
solutious-rudy-0.6.8 vendor/highline-1.5.1/README