2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2011-06-29 20:30:46 -04:00
|
|
|
|
2012-08-22 13:43:16 -04:00
|
|
|
begin
|
|
|
|
require 'psych'
|
|
|
|
rescue LoadError
|
2017-12-12 06:56:25 -05: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 13:43:16 -04:00
|
|
|
raise
|
|
|
|
end
|
|
|
|
|
2013-08-11 23:49:50 -04:00
|
|
|
YAML = Psych # :nodoc:
|
2013-04-28 10:34:22 -04:00
|
|
|
|
2013-04-27 10:26:20 -04:00
|
|
|
# YAML Ain't Markup Language
|
|
|
|
#
|
|
|
|
# This module provides a Ruby interface for data serialization in YAML format.
|
|
|
|
#
|
2018-03-02 07:56:37 -05:00
|
|
|
# The YAML module is an alias of Psych, the YAML engine for Ruby.
|
2013-04-27 10:26:20 -04:00
|
|
|
#
|
2013-05-01 22:24:33 -04:00
|
|
|
# == Usage
|
2013-04-27 10:26:20 -04:00
|
|
|
#
|
|
|
|
# Working with YAML can be very simple, for example:
|
|
|
|
#
|
2014-02-08 14:08:45 -05:00
|
|
|
# require 'yaml'
|
2013-04-27 10: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 07:56:37 -05: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-01 22:24:33 -04:00
|
|
|
# == Security
|
|
|
|
#
|
2013-04-27 10: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-01 22: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 10:26:20 -04:00
|
|
|
# For more advanced details on the implementation see Psych, and also check out
|
2013-04-28 11:40:53 -04:00
|
|
|
# http://yaml.org for spec details and other helpful information.
|
2014-02-08 14:08:45 -05:00
|
|
|
#
|
2019-08-19 04:52:13 -04:00
|
|
|
# Psych is maintained by Aaron Patterson on github: https://github.com/ruby/psych
|
2014-02-08 14:08:45 -05:00
|
|
|
#
|
2019-08-19 04:52:13 -04:00
|
|
|
# Syck can also be found on github: https://github.com/ruby/syck
|
2013-04-28 10:34:22 -04:00
|
|
|
module YAML
|
|
|
|
end
|