UserShell
UserShell is a tiny gem that uses the canonical approach to detect the shell for the current user, or a specified user.
The techniques are ugly so it seemed like it would be worth hiding them behind a gem.
Installation
Add this line to your application's Gemfile:
gem 'usershell'
And then execute:
$ bundle
Or install it yourself as:
$ gem install usershell
Usage
UserShell.path => "/bin/zsh"
UserShell.path('john') => "/usr/local/bin/fish"
Attempting to get the shell path for a user that doesn't exist will raise an ArgumentError.
Contributing
- Fork it
- 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 new Pull Request