Permalink
Browse files

(#16831) Change how bundler is detected

The constant `::Bundler::Setup` isn't defined in the latest version,
instead using just `::Bundler` to detect whether it's been loaded.

See also #16757
  • Loading branch information...
1 parent 6a94ef9 commit 423b37c0aba6b11f7714b9fa599ba7d5ec35136c @joshcooper joshcooper committed Oct 8, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 bin/hiera
View
6 bin/hiera
@@ -11,7 +11,11 @@
#
# $ hiera release 'rel/%{location}' location=dc2 --yaml some.node.yaml
-unless defined? Bundler::Setup
+# Bundler and rubygems maintain a set of directories from which to
+# load gems. If Bundler is loaded, let it determine what can be
+# loaded. If it's not loaded, then use rubygems. But do this before
+# loading any hiera code, so that our gem loading system is sane.
+if not defined? ::Bundler
begin
require 'rubygems'
rescue LoadError

0 comments on commit 423b37c

Please sign in to comment.