2011-06-29 20:30:46 -04:00
|
|
|
##
|
2013-07-18 09:50:32 -04:00
|
|
|
# The YAML module is an alias of Psych, the YAML engine for Ruby.
|
2011-06-29 20:30:46 -04:00
|
|
|
|
2012-08-22 13:43:16 -04:00
|
|
|
begin
|
|
|
|
require 'psych'
|
|
|
|
rescue LoadError
|
|
|
|
warn "#{caller[0]}:"
|
|
|
|
warn "It seems your ruby installation is missing psych (for YAML output)."
|
|
|
|
warn "To eliminate this warning, please install libyaml and reinstall your ruby."
|
|
|
|
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.
|
|
|
|
#
|
2013-05-01 22:24:33 -04:00
|
|
|
# The underlying implementation is the libyaml wrapper Psych.
|
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"
|
|
|
|
#
|
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
|
|
|
#
|
|
|
|
# Pysch is maintained by Aaron Patterson on github: https://github.com/tenderlove/psych
|
|
|
|
#
|
|
|
|
# Syck can also be found on github: https://github.com/tenderlove/syck
|
2013-04-28 10:34:22 -04:00
|
|
|
module YAML
|
|
|
|
end
|