diff options
-rw-r--r-- | COPYING | 8 | ||||
-rw-r--r-- | README | 32 | ||||
-rwxr-xr-x | rbpm.sh | 20 |
3 files changed, 43 insertions, 17 deletions
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. @@ -4,20 +4,28 @@ https://github.com/omp/rbpm Manage multiple Ruby installations with no black magic. -INFO +NOTES - rbpm only manages rubies located in the ~/.rubies directory. This - behaviour can be changed by setting the RUBIES_PATH environment - variable to some other location. - - rbpm does not display information about rubies it does not manage, + rbpm only manages rubies located in the ~/.rubies directory. This behaviour + can be changed by setting the RUBIES_PATH environment variable to some other + location. rbpm does not display information about rubies it does not manage, such as any system-wide install. + rbpm performs a substring match when selecting a ruby, using the highest + matching directory when there are multiple matches. + + +DEPENDENCIES + + bash (>= 4.0) + coreutils (sort) + findutils (xargs) + INSTALLING - Save the script to a safe location, then add the following function - to your ~/.bashrc or equivalent file: + Save the script to a safe location, then add the following function to your + ~/.bashrc or equivalent file: rbpm() { source <(/path/to/rbpm.sh "${@}"); } @@ -74,7 +82,15 @@ USAGE Adding /home/omp/.rubies/ruby-1.8.7-p374/bin to PATH. +AUTHORS + + David Vazgenovich Shakaryan + + LICENSE Distributed under the terms of the MIT License. See included COPYING file for the full license text. + + +# vim: set sw=4 sts=4 ts=4 et tw=79 spell spl=en : @@ -16,6 +16,8 @@ # Placing the above function inside ~/.bashrc (or equivalent) will load # it upon starting your shell. +RBPM_VERSION='0.1' + : ${RUBIES_PATH:="${HOME}/.rubies"} _echo() { @@ -141,15 +143,19 @@ rbpm_clear() { _export } +rbpm_version() { + _echo "rbpm ${RBPM_VERSION}" +} + rbpm_help() { _echo 'Usage: rbpm <command> [args]' _echo _echo 'Commands:' - _echo ' ls List all available rubies.' - _echo ' get Display currently selected ruby.' - _echo ' set Select specified ruby.' - _echo ' clear Clear path of any rubies.' - _echo ' help Display this help information.' + _echo ' ls List all available rubies.' + _echo ' get Display currently selected ruby.' + _echo ' set Select specified ruby.' + _echo ' clear Unselect any selected rubies.' + _echo ' version Display rbpm version.' } case "${1}" in @@ -161,6 +167,10 @@ case "${1}" in rbpm_set "${2}" ;; 'clear') rbpm_clear ;; + 'version') + rbpm_version ;; *) rbpm_help ;; esac + +# vim: set sw=4 sts=4 ts=4 et : |