All Projects → piotrmurach → Tty Which

piotrmurach / Tty Which

Licence: mit
Cross-platform implementation of Unix `which` command

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Tty Which

Tty Table
A flexible and intuitive table generator
Stars: ✭ 161 (+1363.64%)
Mutual labels:  cli, tty, ruby-gem
Tty Prompt
A beautiful and powerful interactive command line prompt
Stars: ✭ 1,210 (+10900%)
Mutual labels:  cli, tty, ruby-gem
Tty Command
Execute shell commands with pretty output logging and capture stdout, stderr and exit status.
Stars: ✭ 348 (+3063.64%)
Mutual labels:  cli, tty, ruby-gem
Saldl
A lightweight well-featured CLI downloader optimized for speed and early preview.
Stars: ✭ 203 (+1745.45%)
Mutual labels:  cli, tty, cross-platform
Tomo
A friendly CLI for deploying Rails apps ✨
Stars: ✭ 260 (+2263.64%)
Mutual labels:  cli, ruby-gem
tty-reader
A set of methods for processing keyboard input in character, line and multiline modes.
Stars: ✭ 73 (+563.64%)
Mutual labels:  ruby-gem, tty
Tty Markdown
Convert a markdown document or text into a terminal friendly output.
Stars: ✭ 275 (+2400%)
Mutual labels:  cli, tty
Peaclock
A responsive and customizable clock, timer, and stopwatch for the terminal.
Stars: ✭ 314 (+2754.55%)
Mutual labels:  cli, tty
Forge
F# CLI tool for project, file, and solution management
Stars: ✭ 233 (+2018.18%)
Mutual labels:  cli, cross-platform
Eiskaltdcpp
File sharing program using DC and ADC protocols
Stars: ✭ 277 (+2418.18%)
Mutual labels:  cli, cross-platform
Tty Spinner
A terminal spinner for tasks that have non-deterministic time frame.
Stars: ✭ 386 (+3409.09%)
Mutual labels:  tty, ruby-gem
tty-tree
Print directory or structured data in a tree like format
Stars: ✭ 54 (+390.91%)
Mutual labels:  ruby-gem, tty
tty-editor
Opens a file or text in the user's preferred editor
Stars: ✭ 26 (+136.36%)
Mutual labels:  ruby-gem, tty
Github cli
GitHub on your command line. Use your terminal, not the browser.
Stars: ✭ 263 (+2290.91%)
Mutual labels:  cli, ruby-gem
tty-platform
Operating system detection
Stars: ✭ 28 (+154.55%)
Mutual labels:  ruby-gem, tty
Topydo
A powerful todo list application for the console, using the todo.txt format.
Stars: ✭ 511 (+4545.45%)
Mutual labels:  cli, cross-platform
Airshare
Cross-platform content sharing in a local network
Stars: ✭ 497 (+4418.18%)
Mutual labels:  cli, cross-platform
Python Mss
An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
Stars: ✭ 582 (+5190.91%)
Mutual labels:  cli, cross-platform
Tty
Toolkit for developing sleek command line apps.
Stars: ✭ 2,329 (+21072.73%)
Mutual labels:  cli, ruby-gem
Fkill Cli
Fabulously kill processes. Cross-platform.
Stars: ✭ 6,418 (+58245.45%)
Mutual labels:  cli, cross-platform
tty logo

TTY::Which Gitter

Gem Version Build Status Build status Code Climate Coverage Status Inline docs

Platform independent implementation of Unix which utility that searches for executable file in the path variable.

TTY::Which provides cross-platform executables search component for TTY toolkit.

Installation

Add this line to your application's Gemfile:

gem 'tty-which'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tty-which

Usage

TTY::Which has which method that searches set of directories for an executable file based on the PATH environment variable.

When the path to an executable program exists, an absolute path is returned, otherwise nil.

For example, to find location for an executable program do:

TTY::Which.which('less')  # => '/usr/bin/less'
TTY::Which.which('git')   # => 'C:\Program Files\Git\bin\git'

You can also check an absolute path to executable:

TTY::Which.which('/usr/bin/ruby')  # => '/usr/bin/ruby'

You can also specify directly the paths to search using :paths keyword:

TTY::Which.which('ruby', paths: ['/usr/local/bin', '/usr/bin', '/bin'])
# => '/usr/local/bin/ruby'

When you're only interesting in knowing that an executable exists on the system use the exist? call:

TTY::Which.exist?('ruby') # => true

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/piotrmurach/tty-which. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  1. Fork it ( https://github.com/piotrmurach/tty-which/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Copyright

Copyright (c) 2015 Piotr Murach. See LICENSE for further details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].