method
load_yaml
v1_9_3_392 -
Show latest stable
- Class:
Gem
load_yaml()public
# File lib/rubygems.rb, line 650
def self.load_yaml
return if @yaml_loaded
test_syck = ENV['TEST_SYCK']
unless test_syck
begin
gem 'psych', '~> 1.2', '>= 1.2.1'
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'
rescue ::LoadError
# If we can't load psych, thats fine, go on.
else
# If 'yaml' has already been required, then we have to
# be sure to switch it over to the newly loaded psych.
if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych"
YAML::ENGINE.yamler = "psych"
end
require 'rubygems/psych_additions'
require 'rubygems/psych_tree'
end
end
require 'yaml'
# If we're supposed to be using syck, then we may have to force
# activate it via the YAML::ENGINE API.
if test_syck and defined?(YAML::ENGINE)
YAML::ENGINE.yamler = "syck" unless YAML::ENGINE.syck?
end
# Now that we're sure some kind of yaml library is loaded, pull
# in our hack to deal with Syck's DefaultKey ugliness.
require 'rubygems/syck_hack'
@yaml_loaded = true
end Related methods
- Class methods
- activate
- activate_dep
- activate_spec
- all_load_paths
- available?
- bin_path
- binary_mode
- bindir
- cache
- cache_dir
- cache_gem
- clear_paths
- config_file
- configuration
- configuration=
- datadir
- default_bindir
- default_dir
- default_exec_format
- default_path
- default_rubygems_dirs
- default_sources
- default_system_source_cache_dir
- default_user_source_cache_dir
- deflate
- dir
- ensure_gem_subdirectories
- ensure_ssl_available
- find_files
- gunzip
- gzip
- host
- host=
- inflate
- latest_load_paths
- latest_rubygems_version
- latest_spec_for
- latest_version_for
- load_env_plugins
- load_path_insert_index
- load_plugin_files
- load_plugins
- load_yaml
- loaded_path?
- location_of_caller
- marshal_version
- path
- paths
- paths=
- platforms
- platforms=
- post_build
- post_install
- post_reset
- post_uninstall
- pre_install
- pre_reset
- pre_uninstall
- prefix
- promote_load_path
- read_binary
- refresh
- required_location
- ruby
- ruby=
- ruby_engine
- ruby_version
- searcher
- searcher=
- source_index
- source_index=
- sources
- sources=
- ssl_available?
- suffix_pattern
- suffixes
- time
- try_activate
- ui
- unresolved_deps
- use_paths
- user_dir
- user_home
- win_platform=
- win_platform?
- Private methods
-
all_partials -
each_load_path -
find_home -
latest_partials -
report_activate_error