Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/clj/puppetlabs/services/jruby_pool_manager/jruby_core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
9k."
:jit)

(def jruby-bundled-gems
"The gem repository inside jruby-stdlib.jar. Contains the 'bundled' gems
that are part of the Ruby Standard Library."
"uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared")

(def default-borrow-timeout
"Default timeout when borrowing instances from the JRuby pool in
milliseconds. Current value is 1200000ms, or 20 minutes."
Expand Down Expand Up @@ -92,8 +97,8 @@
[env :- {schema/Str schema/Str}
config :- jruby-schemas/JRubyConfig]
(if-let [gem-path (:gem-path config)]
(assoc env "GEM_PATH" gem-path)
env))
(assoc env "GEM_PATH" (str gem-path ":" jruby-bundled-gems))
(assoc env "GEM_PATH" jruby-bundled-gems)))

(def proxy-vars-allowed-list
"A list of proxy-related variables that are allowed to be passed the environment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
;; but are not expected to be set in most environments. However, in
;; order to make this more test robust, these variables are always
;; filtered out.
(is (= #{"HOME" "PATH" "GEM_HOME" "JARS_NO_REQUIRE" "JARS_REQUIRE" "RUBY"}
(is (= #{"HOME" "PATH" "GEM_HOME" "GEM_PATH" "JARS_NO_REQUIRE" "JARS_REQUIRE" "RUBY"}
(set (remove (set jruby-core/proxy-vars-allowed-list) (keys jruby-env)))))))))

(deftest jruby-configured-env-vars
Expand All @@ -28,6 +28,6 @@
;; but are not expected to be set in most environments. However, in
;; order to make this test more robust, these variables are always
;; filtered out.
(is (= #{"HOME" "PATH" "GEM_HOME" "JARS_NO_REQUIRE" "JARS_REQUIRE" "FOO" "RUBY"}
(is (= #{"HOME" "PATH" "GEM_HOME" "GEM_PATH" "JARS_NO_REQUIRE" "JARS_REQUIRE" "FOO" "RUBY"}
(set (remove (set jruby-core/proxy-vars-allowed-list) (keys jruby-env)))))
(is (= (.get jruby-env "FOO") "for_jruby"))))))