1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-01 19:49:25 +00:00

[Fix #503] Prefix rails aliases with 'bundle exec'

This commit is contained in:
Sorin Ionescu
2013-11-27 12:31:08 -05:00
parent b1abe7a845
commit 50edc45132
3 changed files with 39 additions and 45 deletions

View File

@ -59,6 +59,7 @@ Aliases
Functions
---------
- `ruby-app-root` displays the path to the Ruby application root directory.
- `ruby-info` exposes information about the Ruby environment via the
`$ruby_info` associative array.

View File

@ -0,0 +1,19 @@
#
# Displays the path to the Ruby application root directory.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
local root_dir="$PWD"
while [[ "$root_dir" != '/' ]]; do
if [[ -f "$root_dir/Gemfile" ]]; then
print "$root_dir"
break
fi
root_dir="$root_dir:h"
done
return 1