diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-10-07 21:41:32 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-10-09 23:33:47 -0300 |
commit | 731be63f0b30a8e9dd64e580b8215df0e3ec46b9 (patch) | |
tree | acb9ff265617cd171d269b859e6e05feccaa08be /README.md | |
parent | 1741236aa6475efe5bf265a325b2b2ee4ec82bd4 (diff) | |
download | highline-731be63f0b30a8e9dd64e580b8215df0e3ec46b9.tar.gz |
Rename README.rdoc README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..fd5af90 --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ += HighLine + +by James Edward Gray II + +{<img src="https://travis-ci.org/JEG2/highline.svg" alt="Build Status" />}[https://travis-ci.org/JEG2/highline] +{<img src="https://ci.appveyor.com/api/projects/status/4p05fijpah77d28x?svg=true" alt="AppVeyor Build Status" />}[https://ci.appveyor.com/project/abinoam/highline] +{<img src="https://img.shields.io/gem/v/highline.svg?style=flat" />}[http://rubygems.org/gems/highline] +{<img src="https://codeclimate.com/github/JEG2/highline/badges/gpa.svg" />}[https://codeclimate.com/github/JEG2/highline] +{<img src="https://codeclimate.com/github/JEG2/highline/badges/coverage.svg" />}[https://codeclimate.com/github/JEG2/highline/coverage] + +== 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. + +Start hacking in your code with HighLine with: + + require 'highline/import' + +== 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. + +== Requirements + +HighLine from version >= 1.7.0 requires ruby >= 1.9.3 + +== 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. |