2015-12-16 08:07:31 +03:00
|
|
|
# frozen_string_literal: false
|
2011-06-30 04:30:46 +04:00
|
|
|
|
2012-08-22 21:43:16 +04:00
|
|
|
begin
|
|
|
|
require 'psych'
|
|
|
|
rescue LoadError
|
2022-01-27 08:29:17 +03:00
|
|
|
case RUBY_ENGINE
|
|
|
|
when 'jruby'
|
|
|
|
warn "The Psych YAML extension failed to load.\n" \
|
|
|
|
"Check your env for conflicting versions of SnakeYAML\n" \
|
|
|
|
"See https://github.com/jruby/jruby/wiki/FAQs#why-does-the-psych-yaml-extension-fail-to-load-in-my-environment",
|
|
|
|
uplevel: 1
|
|
|
|
else
|
|
|
|
warn "It seems your ruby installation is missing psych (for YAML output).\n" \
|
|
|
|
"To eliminate this warning, please install libyaml and reinstall your ruby.\n",
|
|
|
|
uplevel: 1
|
|
|
|
end
|
2012-08-22 21:43:16 +04:00
|
|
|
raise
|
|
|
|
end
|
|
|
|
|
2013-08-12 07:49:50 +04:00
|
|
|
YAML = Psych # :nodoc:
|
2013-04-28 18:34:22 +04:00
|
|
|
|
2013-04-27 18:26:20 +04:00
|
|
|
# YAML Ain't Markup Language
|
|
|
|
#
|
|
|
|
# This module provides a Ruby interface for data serialization in YAML format.
|
|
|
|
#
|
2018-03-02 15:56:37 +03:00
|
|
|
# The YAML module is an alias of Psych, the YAML engine for Ruby.
|
2013-04-27 18:26:20 +04:00
|
|
|
#
|
2013-05-02 06:24:33 +04:00
|
|
|
# == Usage
|
2013-04-27 18:26:20 +04:00
|
|
|
#
|
|
|
|
# Working with YAML can be very simple, for example:
|
|
|
|
#
|
2014-02-08 23:08:45 +04:00
|
|
|
# require 'yaml'
|
2013-04-27 18:26:20 +04:00
|
|
|
# # Parse a YAML string
|
|
|
|
# YAML.load("--- foo") #=> "foo"
|
|
|
|
#
|
|
|
|
# # Emit some YAML
|
|
|
|
# YAML.dump("foo") # => "--- foo\n...\n"
|
|
|
|
# { :a => 'b'}.to_yaml # => "---\n:a: b\n"
|
|
|
|
#
|
2018-03-02 15:56:37 +03:00
|
|
|
# As the implementation is provided by the Psych library, detailed documentation
|
|
|
|
# can be found in that library's docs (also part of standard library).
|
|
|
|
#
|
2013-05-02 06:24:33 +04:00
|
|
|
# == Security
|
|
|
|
#
|
2013-04-27 18:54:37 +04:00
|
|
|
# Do not use YAML to load untrusted data. Doing so is unsafe and could allow
|
|
|
|
# malicious input to execute arbitrary code inside your application. Please see
|
|
|
|
# doc/security.rdoc for more information.
|
|
|
|
#
|
2013-05-02 06:24:33 +04:00
|
|
|
# == History
|
|
|
|
#
|
2020-04-29 18:39:09 +03:00
|
|
|
# Syck was the original YAML implementation in Ruby's standard library
|
2013-05-02 06:24:33 +04:00
|
|
|
# developed by why the lucky stiff.
|
|
|
|
#
|
|
|
|
# You can still use Syck, if you prefer, for parsing and emitting YAML, but you
|
|
|
|
# must install the 'syck' gem now in order to use it.
|
|
|
|
#
|
|
|
|
# In older Ruby versions, ie. <= 1.9, Syck is still provided, however it was
|
|
|
|
# completely removed with the release of Ruby 2.0.0.
|
|
|
|
#
|
|
|
|
# == More info
|
|
|
|
#
|
2013-04-27 18:26:20 +04:00
|
|
|
# For more advanced details on the implementation see Psych, and also check out
|
2013-04-28 19:40:53 +04:00
|
|
|
# http://yaml.org for spec details and other helpful information.
|
2014-02-08 23:08:45 +04:00
|
|
|
#
|
2019-08-19 11:52:13 +03:00
|
|
|
# Psych is maintained by Aaron Patterson on github: https://github.com/ruby/psych
|
2014-02-08 23:08:45 +04:00
|
|
|
#
|
2019-08-19 11:52:13 +03:00
|
|
|
# Syck can also be found on github: https://github.com/ruby/syck
|
2013-04-28 18:34:22 +04:00
|
|
|
module YAML
|
2024-11-06 10:32:42 +03:00
|
|
|
LOADER_VERSION = "0.4.0"
|
2013-04-28 18:34:22 +04:00
|
|
|
end
|