 
   See also:  http://jruby.org/apidocs/org/jruby/runtime/load/LoadService.html"
   "puppet-server-lib")
+
+(def compile-mode
+  "The JRuby compile mode to use for all ruby components, e.g. the master
+  service and CLI tools."
+  RubyInstanceConfig$CompileMode/OFF)
+
+(def compat-version
+  "The JRuby compatibility version to use for all ruby components, e.g. the
+  master service and CLI tools."
+  (CompatVersion/RUBY1_9))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Private


(defn prep-scripting-container
  [scripting-container ruby-load-path gem-home]
  (doto scripting-container
    (.setLoadPaths (managed-load-path ruby-load-path))
    (.setCompatVersion (CompatVersion/RUBY1_9))
    (.setCompileMode RubyInstanceConfig$CompileMode/OFF)
    (.setEnvironment (managed-environment (get-system-env) gem-home))))

(defn empty-scripting-container

  [config :- jruby-schemas/JRubyPuppetConfig]
  (let [jruby-config (RubyInstanceConfig.)
        {:keys [ruby-load-path gem-home]} config]
    ; Note, this behavior should remain consistent with prep-scripting-container
    (doto jruby-config
      (.setLoadPaths (managed-load-path ruby-load-path))
      (.setCompatVersion compat-version)
      (.setCompileMode compile-mode)
      (.setEnvironment (managed-environment (get-system-env) gem-home)))
    (Main. jruby-config)))
