aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-06-30 23:01:35 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-06-30 23:01:35 -0700
commit1930d2e3c5a597a37594af623e4d4dfe8e402969 (patch)
treea07465cf7b0ef5c52f19cdf4321293ebc09637ec
parentb869f4894b409af42ff2ab8515d85f81ae4cc7eb (diff)
downloadrbpm-1930d2e3c5a597a37594af623e4d4dfe8e402969.tar.gz
rbpm-1930d2e3c5a597a37594af623e4d4dfe8e402969.tar.xz
Minor changes and documentation cleanup.
-rw-r--r--COPYING8
-rw-r--r--README32
-rwxr-xr-xrbpm.sh20
3 files changed, 43 insertions, 17 deletions
diff --git a/COPYING b/COPYING
index 178f029..415fdd6 100644
--- a/COPYING
+++ b/COPYING
@@ -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.
diff --git a/README b/README
index d20736b..f7ce5e8 100644
--- a/README
+++ b/README
@@ -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 :
diff --git a/rbpm.sh b/rbpm.sh
index e452e52..290b9f1 100755
--- a/rbpm.sh
+++ b/rbpm.sh
@@ -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 :