puppetlabs/puppetlabs-stdlib — pull request #34 by jeffmccune (2012-02-06 05:25:32+00:00)
Title: (#12377) Avoid infinite loop when retrying require json

Without this patch an infinite loop will be entered if the json and
rubygems libraries are not available.

This patch fixes the problem by retrying the `require 'json'` only if
rubygems was successfully loaded for the first time. Subsequent
attempts to load rubygems will cause the LoadError exception from a
missing json library to be re-raised.

Thanks to Krzysztof Wilczynski for pointing out this issue.