Permalink
Browse files

Set the version of the parent kirk in the sub process

  • Loading branch information...
carllerche committed Feb 24, 2011
1 parent 237aeae commit 87a05d1fb6c671b0366dcc56a8f816120eb304a5
View
@@ -29,7 +29,7 @@ module Kirk
java_import "java.util.logging.ConsoleHandler"
def self.sub_process?
- !!defined?(Kirk::SUB_PROCESS)
+ !!defined?(Kirk::PARENT_VERSION)
end
# Configure the logger
@@ -44,5 +44,13 @@ def getEnvironment
map
end
+
+ def getKirkVersionStamper
+ <<-RUBY
+ module Kirk
+ PARENT_VERSION = #{VERSION.inspect}.freeze
+ end
+ RUBY
+ end
end
end
@@ -1,8 +1,6 @@
require 'java'
module Kirk
- SUB_PROCESS = true
-
class Server
class Bootstrap
def warmup(application_path)
@@ -8,6 +8,7 @@
public String getApplicationPath();
public String getRackupPath();
public String getBootstrapPath();
+ public String getKirkVersionStamper();
public Map getEnvironment();
public LifeCycle.Listener getLifeCycleListener();
@@ -49,6 +49,7 @@ public void terminate() {
private void initializeScriptingContext() {
context = new ScriptingContainer(LocalContextScope.SINGLETHREAD);
context.setEnvironment(config.getEnvironment());
+ context.runScriptlet(config.getKirkVersionStamper());
this.bootstrapper = context.runScriptlet(
PathType.ABSOLUTE, config.getBootstrapPath());

0 comments on commit 87a05d1

Please sign in to comment.