Platform independent implementation of Unix
whichutility that searches for executable file in the path variable.
TTY::Which provides cross-platform executables search component for TTY toolkit.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install tty-which
which method that searches the path for executable file.
When the path to executable exists, an absolute path is returned, otherwise
For example, to find location for a single executable do:
::.('less') # => '/usr/bin/less' ::.('git') # => 'C:\Program Files\Git\bin\git'
You can also check an absolute path to executable:
::.('/usr/bin/ruby') # => '/usr/bin/ruby'
true if the executable exists in the path and
::.('ruby') # => true
- Fork it ( https://github.com/piotrmurach/tty-which/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
Copyright (c) 2015-2017 Piotr Murach. See LICENSE for further details.