jruby/warbler — pull request #148 by garylin (2013-04-05 00:49:12+00:00)
Title: Resolving issue when an alternate BUNDLE_PATH is used

Issue description:

If BUNDLE_PATH in .bundle/config is set to some other directory, for example

BUNDLE_PATH: vendor/foobar

or if bundle install was previous executed with --path parameter

bundle install --path vendor/foobar

Warbler will not able to detect the bundler's gemspec location correctly (from the bundler's load_from attribute). As the result, a corrupted bundle gem will be included into the war file and we will see a load error when attempting to run this war file inside a servlet container.

Analysis:

The existing code seems to have some logic that tries to detect the location of the bundler.gemspec based on the bundler's load_from attribute. However, the implementation quits after looking up parent folder two times and silently continue without raising any error.

Proposed Change:

Instead of just lookup parent folders for 2 levels, the fix keep searching for the bundler gemspec until it hits the root dir. If bundler gemspec cannot be found, it will raise an error message and exit the build process.