Rails 2.3.3 loads the json gem, if present, so that it can override it. This thwarts our preloading of rails in order to override it with the json gem. To restore the ballence of terror this patch removes the json gem from the list of loaded modules after rails loads it so that we can then load it. Expliatives implied.
Signed-off-by: Markus Roberts <[email protected]> --- lib/puppet/feature/rails.rb | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb index 87b408c..730a308 100644 --- a/lib/puppet/feature/rails.rb +++ b/lib/puppet/feature/rails.rb @@ -9,6 +9,7 @@ Puppet.features.add(:rails) do begin require 'active_record' require 'active_record/version' + require 'active_support/json' rescue LoadError => detail if FileTest.exists?("/usr/share/rails") count = 0 @@ -34,6 +35,12 @@ Puppet.features.add(:rails) do else true end + + # Active_support 2.3.3 and later load the gem's json in order to neuter it. + # We remove its files from the loaded-file list so we can load them. + # + ["json/version.rb", "json/common.rb", "json/ext/parser.bundle", "json/ext/generator.bundle", "json/ext.rb", "json.rb"].each {|x| $".delete x } + end # We have JSON available -- 1.6.4 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---
