Permalink
Browse files

Set BUNDLE_WITHOUT from init.rb

init.rb expects $servelet_container to be set. Luckily, it uses ||= to
set those env variables. To move forward, I'm pre-setting them so that
$servelet_container isn't used (since it is not set), but this
could/should be done much nicer.
  • Loading branch information...
1 parent 1ff2ec7 commit d617414440ce39bac263b508a7afb4b4985fbd78 @bjeanes bjeanes committed Mar 11, 2013
Showing with 3 additions and 7 deletions.
  1. +3 −7 ext/WarMain.java
View
10 ext/WarMain.java
@@ -246,24 +246,20 @@ protected String locateExecutable(final Object scriptingContainer) throws Except
return (String) invokeMethod(scriptingContainer, "runScriptlet", script);
}
}
-
protected String executableScriptEnvPrefix() {
final String gemsDir = new File(extractRoot, "gems").getAbsolutePath();
final String gemfile = new File(extractRoot, "Gemfile").getAbsolutePath();
debug("setting GEM_HOME to " + gemsDir);
debug("... and BUNDLE_GEMFILE to " + gemfile);
- return "ENV['GEM_HOME'] = ENV['GEM_PATH'] = '"+ gemsDir +"' \n" +
- "ENV['BUNDLE_GEMFILE'] = '"+ gemfile +"' \n" +
-
- // FIXME: get this from web.xml config?
- "ENV['BUNDLE_WITHOUT'] = 'assets:development:test' \n";
+ return "ENV['GEM_HOME'] ||= ENV['GEM_PATH'] = '"+ gemsDir +"' \n" +
+ "ENV['BUNDLE_GEMFILE'] ||= '"+ gemfile +"' \n" +
+ "require 'META-INF/init.rb' \n";
}
// TODO move this into an ERB template
protected String locateExecutableScript(final String executable) {
return executableScriptEnvPrefix() +
"begin\n" +
- " require 'META-INF/init.rb' \n" +
// locate the executable within gemspecs :
" require 'rubygems' \n" +
" begin\n" +

0 comments on commit d617414

Please sign in to comment.