# File lib/rubygems.rb, line 645 def self.load_yaml begin gem 'psych', '~> 1.2', '>= 1.2.1' unless ENV['TEST_SYCK'] rescue Gem::LoadError # It's OK if the user does not have the psych gem installed. We will # attempt to require the stdlib version end begin # Try requiring the gem version *or* stdlib version of psych. require 'psych' unless ENV['TEST_SYCK'] rescue ::LoadError ensure require 'yaml' end # Hack to handle syck's DefaultKey bug with psych. # See the note at the top of lib/rubygems/requirement.rb for # why we end up defining DefaultKey more than once. if !defined? YAML::Syck YAML.module_eval do const_set 'Syck', Module.new { const_set 'DefaultKey', Class.new } end end end