2015-12-16 08:07:31 +03:00
|
|
|
# frozen_string_literal: false
|
2011-06-30 04:30:46 +04:00
|
|
|
##
|
2013-07-18 17:50:32 +04:00
|
|
|
# The YAML module is an alias of Psych, the YAML engine for Ruby.
|
2011-06-30 04:30:46 +04:00
|
|
|
|
2012-08-22 21:43:16 +04:00
|
|
|
begin
|
|
|
|
require 'psych'
|
|
|
|
rescue LoadError
|
2017-12-12 14:56:25 +03:00
|
|
|
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
|
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.
|
|
|
|
#
|
2013-05-02 06:24:33 +04:00
|
|
|
# The underlying implementation is the libyaml wrapper Psych.
|
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"
|
|
|
|
#
|
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
|
|
|
|
#
|
|
|
|
# Syck was the original for YAML implementation in Ruby's standard library
|
|
|
|
# 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
|
|
|
#
|
2015-05-03 15:59:52 +03:00
|
|
|
# Psych is maintained by Aaron Patterson on github: https://github.com/tenderlove/psych
|
2014-02-08 23:08:45 +04:00
|
|
|
#
|
|
|
|
# Syck can also be found on github: https://github.com/tenderlove/syck
|
2013-04-28 18:34:22 +04:00
|
|
|
module YAML
|
|
|
|
end
|