README 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. README
  2. ======
  3. bundler-bin provides a Bash function that updates your PATH environment
  4. variable to include a project's ./bin directory if the project's Ruby gem
  5. dependencies are being managed with bundler.
  6. You can find bundler here: http://github.com/wycats/bundler
  7. Gems that are managed by bundler will install their scripts in a directory
  8. called `<project-root>/bin`, and you should run these commands in preference
  9. to the commands that are installed with your system's gems. If your
  10. project's bin directory is not in your path it's very easy to forget to
  11. specify the correct command, which can cause no end of subtle problems.
  12. bundler-bin fixes this problem by automatically updating your PATH as you
  13. change directories. It defines a function for updating PATH via the Bash
  14. PROMPT_COMMAND hook.
  15. bundler-bin requires Bash 3.0 or greater to work.
  16. Usage:
  17. 1. Copy bundler-bin.sh to ~/.bundler-bin.sh.
  18. 2. Set PROJECT_ROOT to the parent directory of your bundled projects
  19. (e.g. ~/code). Why is this needed? See update_bundler_path in the code.
  20. 3. Source it from your ~/.bashrc file.
  21. For example:
  22. $ cp bundler-bin/bundler-bin.sh ~/.bundler-bin.sh
  23. $ echo "PROJECT_ROOT=~/code" >> ~/.bashrc
  24. $ echo "[ -f ~/.bundler-bin.sh ] && source ~/.bundler-bin.sh" >> ~/.bashrc
  25. That's it... cd into a bundled project and try `echo $PATH` to see if
  26. it works!