method
load_yaml
v2_4_6 -
Show latest stable
- Class:
Gem
load_yaml()public
# File lib/rubygems.rb, line 667
def self.load_yaml
return if @yaml_loaded
return unless defined?(gem)
test_syck = ENV['TEST_SYCK']
# Only Ruby 1.8 and 1.9 have syck
test_syck = false unless /^1\./ =~ RUBY_VERSION
unless test_syck
begin
gem 'psych', '>= 2.0.0'
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'
require 'rubygems/safe_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_bin_path
- bin_path
- binary_mode
- bindir
- clear_default_specs
- clear_paths
- config_file
- configuration
- configuration=
- datadir
- default_bindir
- default_cert_path
- default_dir
- default_exec_format
- default_ext_dir_for
- default_gems_use_full_paths?
- default_key_path
- default_path
- default_rubygems_dirs
- default_sources
- default_spec_cache_dir
- deflate
- detect_gemdeps
- dir
- done_installing
- ensure_default_gem_subdirectories
- ensure_gem_subdirectories
- ensure_subdirectories
- env_requirement
- extension_api_version
- find_files
- find_files_from_load_path
- find_latest_files
- find_unresolved_default_spec
- finish_resolve
- gunzip
- gzip
- host
- host=
- inflate
- install
- install_extension_in_lib
- latest_rubygems_version
- latest_spec_for
- latest_version_for
- load_env_plugins
- load_path_insert_index
- load_plugin_files
- load_plugins
- load_yaml
- location_of_caller
- marshal_version
- needs
- path
- path_separator
- paths
- paths=
- platform_defaults
- platforms
- platforms=
- post_build
- post_install
- post_reset
- post_uninstall
- pre_install
- pre_reset
- pre_uninstall
- prefix
- read_binary
- refresh
- register_default_spec
- remove_unresolved_default_spec
- ruby
- ruby=
- ruby_api_version
- ruby_engine
- ruby_version
- rubygems_version
- searcher=
- sources
- sources=
- spec_cache_dir
- suffix_pattern
- suffixes
- time
- try_activate
- ui
- use_gemdeps
- use_paths
- user_dir
- user_home
- vendor_dir
- win_platform=
- win_platform?
- write_binary
- Private methods
-
find_home -
find_spec_for_exe