4.7.2. Example of a Loadable Bundle

The following is an example of a loadable bundle. In this case, the bundle is Ruby version 1.8.6 running on the Intel version of Mac OS X.

ruby/
   1.8.6/
      bundle/
         actions/
            load.sh
            unload.sh
         info
      macosx-x86/
         bin/
            erb, irb, rdoc, ri, ruby, testrb
         lib/
            libruby-static.a
            ruby/
               ...ruby lib directories...
         share/
            man/
               ...ruby man pages...

The directory 'macosx-x86' contains the standard ruby distribution, built from source. The 'load' bundle hook in this bundle simply sets the PATH environment variable using one of the built-in BundleWorks functions:

env_prepend_path PATH $BUNDLE_HOME/$PLATFORM/bin

The 'unload' hook is similar:

env_unprepend_path PATH $BUNDLE_HOME/$PLATFORM/bin