2011-08-17 18:35:23 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# `ruby-local-exec` is a drop-in replacement for the standard Ruby
|
|
|
|
# shebang line:
|
|
|
|
#
|
|
|
|
# #!/usr/bin/env ruby-local-exec
|
|
|
|
#
|
|
|
|
# Use it for scripts inside a project with an `.rbenv-version`
|
|
|
|
# file. When you run the scripts, they'll use the project-specified
|
|
|
|
# Ruby version, regardless of what directory they're run from. Useful
|
|
|
|
# for e.g. running project tasks in cron scripts without needing to
|
|
|
|
# `cd` into the project first.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2011-09-27 16:50:39 -04:00
|
|
|
if [ -z "$RBENV_DIR" ]; then
|
|
|
|
export RBENV_DIR="${1%/*}"
|
|
|
|
fi
|
2011-08-17 18:35:23 -04:00
|
|
|
|
|
|
|
exec ruby "$@"
|