A summary of data about the Ruby ecosystem.

https://github.com/JEG2/highline

A higher level command-line oriented interface.
https://github.com/JEG2/highline

Keywords from Contributors

rubygems activerecord mvc activejob rubocop rack sinatra feature-flag crash-reporting code-formatter

Last synced: about 17 hours ago
JSON representation

Repository metadata

A higher level command-line oriented interface.

README.md

HighLine

Tests
Gem Version
Code Climate
Test Coverage
Inline docs

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: Rubydoc.info for HighLine.
Specially HighLine and HighLine::Question.

Usage


require 'highline'

# Basic usage

cli = HighLine.new
answer = cli.ask "What do you think?"
puts "You have answered: #{answer}"


# Default answer

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

## Disable default value hint showing

my_special_default_object = Object.new

cli.ask("Question?  ") do |q|
  q.default = my_special_default_object
  q.default_hint_show = false
end


# Validation

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

## Validation with custom class
class ZeroToTwentyFourValidator
  def self.valid?(answer)
    (0..24).include? answer.to_i
  end

  def self.inspect
    "(0..24) rule"
  end
end

cli.ask("What hour of the day is it?:  ", Integer) do |q|
  q.validate = ZeroToTwentyFourValidator
end

## Validation with Dry::Types
## `Dry::Types` provides a `valid?` method so it can be used effortlessly

require 'dry-type'

module Types
  include Dry.Types
end

cli.ask("Type an integer:", Integer) do |q|
  q.validate = Types::Coercible::Integer
end

# Type conversion for answers:

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


# Reading passwords:

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


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

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


# Menus:

cli.choose do |menu|
  menu.prompt = "Please choose your favorite programming language?  "
  menu.choice(:ruby) { cli.say("Good choice!") }
  menu.choices(:python, :perl) { cli.say("Not from around here, are you?") }
  menu.default = :ruby
end

## Using colored indices on Menus

HighLine::Menu.index_color   = :rgb_77bbff # set default index color

cli.choose do |menu|
  menu.index_color  = :rgb_999999      # override default color of index
                                       # you can also use constants like :blue
  menu.prompt = "Please choose your favorite programming language?  "
  menu.choice(:ruby) { cli.say("Good choice!") }
  menu.choices(:python, :perl) { cli.say("Not from around here, are you?") }
end

If you want to save some characters, you can inject/import HighLine methods on Kernel by doing the following. Just be sure to avoid name collisions in the top-level namespace.

require 'highline/import'

say "Now you can use #say directly"

For more examples see the examples/ directory of this project.

Requirements

HighLine from version >= 3.0.0 requires ruby >= 3.0.0

Installing

To install HighLine, use the following command:

$ gem install highline

(Add sudo if you're installing under a POSIX system as root)

If you're using Bundler, add this to your Gemfile:

source "https://rubygems.org"
gem 'highline'

And then run:

$ bundle

If you want to build the gem locally, use the following command from the root of the sources:

$ rake package

You can also build and install directly:

$ rake install

Contributing

  1. Open an issue
  1. Fork the repository
  1. Clone it locally
  • git clone git@github.com:YOUR-USERNAME/highline.git
  1. Add the main HighLine repository as the upstream remote
  • cd highline # to enter the cloned repository directory.
  • git remote add upstream https://github.com/JEG2/highline
  1. Keep your fork in sync with upstream
  • git fetch upstream
  • git checkout master
  • git merge upstream/master
  1. Create your feature branch
  • git checkout -b your_branch
  1. Hack the source code, run the tests and pronto
  • rake test
  • rake acceptance
  • pronto run

Alternatively, if you're in a Dockerised environment,
don't care about installing anything locally -- just run bin/test instead.

  1. Commit your changes
  • git commit -am "Your commit message"
  1. Push it
  • git push
  1. Open a pull request

Details on:

The Core HighLine Team

For a list of people who have contributed to the codebase, see GitHub's list of contributors.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 2 days ago

Total Commits: 1,059
Total Committers: 72
Avg Commits per committer: 14.708
Development Distribution Score (DDS): 0.412

Commits in past year: 1
Committers in past year: 1
Avg Commits per committer in past year: 1.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Abinoam Praxedes Marques Jr a****m@g****m 623
James Gray j****s@g****t 151
Gregory Brown g****n@g****m 50
Tom Copeland n****e@n****m 25
matugm m****m@g****m 22
Richard LeBer r****r@g****m 18
matrinox g****1@m****m 12
Dāvis d****h@g****m 10
Justin Collins j****n@p****m 10
Mina Nagy Zaki m****i@g****m 8
Marcus Stollsteimer s****r@w****e 8
Stephen Bannasch s****h@g****m 7
Peter Goldstein p****n@g****m 6
Thomas Dudziak t****s@n****m 5
Aregic a****c@g****m 5
Keith Bennett k****t@v****m 4
Ana María Martínez Gómez a****a@m****e 4
Frederico f****t@g****m 4
Lachlan Dowding l****g@g****m 4
michael m****l@i****t 3
Koichi ITO k****o@g****m 3
Kenichi Kamiya k****1@g****m 3
Fission Xuiptz f****z@s****m 3
Eli Young e****e@g****m 3
Aaron D. Gifford h****/ 3
Scott Gonyea s****a@t****m 3
mmihira m****w@g****m 3
Costa Shapiro c****a@m****m 2
Chad Gorshing g****g@g****m 2
Eric Saxby s****x@l****g 2
and 42 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 5 days ago

Total issues: 49
Total pull requests: 76
Average time to close issues: over 1 year
Average time to close pull requests: 18 days
Total issue authors: 43
Total pull request authors: 29
Average comments per issue: 4.27
Average comments per pull request: 2.38
Merged pull request: 65
Bot issues: 0
Bot pull requests: 0

Past year issues: 2
Past year pull requests: 1
Past year average time to close issues: 20 days
Past year average time to close pull requests: about 8 hours
Past year issue authors: 2
Past year pull request authors: 1
Past year average comments per issue: 4.5
Past year average comments per pull request: 1.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/JEG2/highline

Top Issue Authors

  • abinoam (3)
  • costa (2)
  • jblaine (2)
  • tukanos (2)
  • maurobender (2)
  • satmandu (1)
  • Joshfindit (1)
  • dantman (1)
  • aspyct (1)
  • doriantaylor (1)
  • esotericpig (1)
  • 64kramsystem (1)
  • pineapplethief (1)
  • guyisra (1)
  • Fryguy (1)

Top Pull Request Authors

  • abinoam (37)
  • koic (3)
  • zvkemp (2)
  • fredrb (2)
  • blipper (2)
  • olleolleolle (2)
  • davidjkling (2)
  • mark-young-atg (2)
  • costa (2)
  • petergoldstein (2)
  • matrinox (2)
  • pietromenna (1)
  • LinusU (1)
  • tukanos (1)
  • kevinoid (1)

Top Issue Labels

  • feature request (15)
  • bug (9)
  • question (6)

Top Pull Request Labels

  • feature request (4)
  • bug (2)

Package metadata

gem.coop: highline

A high-level IO library that provides validation, type conversion, and more for command-line interfaces. HighLine also includes a complete menu system that can crank out anything from simple list selection to complete shells with just minutes of work.

  • Homepage: https://github.com/JEG2/highline
  • Documentation: http://www.rubydoc.info/gems/highline/
  • Licenses: Ruby
  • Latest release: 3.1.2 (published over 1 year ago)
  • Last Synced: 2026-05-22T02:31:05.198Z (2 days ago)
  • Versions: 72
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 318,935,947 Total
  • Docker Downloads: 316,230,021
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Downloads: 0.082%
    • Average: 0.12%
    • Docker downloads count: 0.4%
  • Maintainers (4)
rubygems.org: highline

A high-level IO library that provides validation, type conversion, and more for command-line interfaces. HighLine also includes a complete menu system that can crank out anything from simple list selection to complete shells with just minutes of work.

  • Homepage: https://github.com/JEG2/highline
  • Documentation: http://www.rubydoc.info/gems/highline/
  • Licenses: Ruby
  • Latest release: 3.1.2 (published over 1 year ago)
  • Last Synced: 2026-05-21T19:01:01.455Z (2 days ago)
  • Versions: 72
  • Dependent Packages: 1,560
  • Dependent Repositories: 77,935
  • Downloads: 318,876,210 Total
  • Docker Downloads: 316,230,021
  • Rankings:
    • Dependent packages count: 0.033%
    • Downloads: 0.079%
    • Dependent repos count: 0.132%
    • Docker downloads count: 0.496%
    • Average: 0.774%
    • Stargazers count: 1.714%
    • Forks count: 2.19%
  • Maintainers (4)
proxy.golang.org: github.com/JEG2/highline

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/JEG2/highline#section-documentation
  • Licenses: other
  • Latest release: v3.1.2+incompatible (published over 1 year ago)
  • Last Synced: 2026-05-20T03:02:06.524Z (4 days ago)
  • Versions: 23
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 1.836%
    • Forks count: 2.329%
    • Average: 6.136%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
proxy.golang.org: github.com/jeg2/highline

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/jeg2/highline#section-documentation
  • Licenses: other
  • Latest release: v3.1.2+incompatible (published over 1 year ago)
  • Last Synced: 2026-05-20T03:02:06.320Z (4 days ago)
  • Versions: 23
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 1.836%
    • Forks count: 2.329%
    • Average: 6.136%
    • Dependent packages count: 9.576%
    • Dependent repos count: 10.802%
debian-13: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Documentation: https://packages.debian.org/trixie/ruby-highline
  • Licenses: other
  • Latest release: 3.1.2-1 (published 3 months ago)
  • Last Synced: 2026-03-14T18:09:40.838Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Licenses: other
  • Latest release: 3.0.1-1 (published 4 months ago)
  • Last Synced: 2026-03-06T15:59:21.440Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Documentation: https://packages.debian.org/bookworm/ruby-highline
  • Licenses: other
  • Latest release: 2.0.3-2 (published 3 months ago)
  • Last Synced: 2026-03-13T23:43:29.046Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.10: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Licenses: other
  • Latest release: 3.0.1-1 (published 3 months ago)
  • Last Synced: 2026-03-09T17:06:39.996Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Licenses: other
  • Latest release: 2.0.3-2 (published 3 months ago)
  • Last Synced: 2026-03-14T03:14:29.197Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-10: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Documentation: https://packages.debian.org/buster/ruby-highline
  • Licenses: other
  • Latest release: 1.7.8-1 (published 3 months ago)
  • Last Synced: 2026-03-13T19:03:58.304Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-11: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Documentation: https://packages.debian.org/bullseye/ruby-highline
  • Licenses: other
  • Latest release: 2.0.3-2 (published 3 months ago)
  • Last Synced: 2026-03-14T06:23:12.409Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Licenses: other
  • Latest release: 2.0.3-2 (published 3 months ago)
  • Last Synced: 2026-03-11T18:33:32.268Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-22.04: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Licenses: other
  • Latest release: 2.0.3-2 (published 3 months ago)
  • Last Synced: 2026-03-13T23:37:28.011Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-20.04: ruby-highline

  • Homepage: https://github.com/JEG2/highline
  • Licenses: other
  • Latest release: 2.0.3-1 (published 3 months ago)
  • Last Synced: 2026-03-13T14:28:24.360Z (2 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
guix: ruby-highline

HighLine helps you build command-line interfaces

  • Homepage: https://github.com/JEG2/highline
  • Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ruby-xyz.scm#n163
  • Licenses: gpl2, ruby
  • Latest release: 3.1.2 (published 3 months ago)
  • Last Synced: 2026-04-27T16:19:10.987Z (26 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

Gemfile rubygems
  • flog >= 0 development
  • pronto >= 0 development
  • pronto-flay >= 0 development
  • pronto-poper >= 0 development
  • pronto-reek >= 0 development
  • pronto-rubocop >= 0 development
  • simplecov >= 0 development
highline.gemspec rubygems
  • bundler >= 0 development
  • minitest >= 0 development
  • rake >= 0 development
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite

Score: 32.42081977944957