ruby-changes:28447
From: zzak <ko1@a...>
Date: Sat, 27 Apr 2013 23:26:32 +0900 (JST)
Subject: [ruby-changes:28447] zzak:r40499 (trunk): * lib/yaml.rb: Documentation for YAML module [Bug #8213]
zzak 2013-04-27 23:26:20 +0900 (Sat, 27 Apr 2013) New Revision: 40499 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40499 Log: * lib/yaml.rb: Documentation for YAML module [Bug #8213] Modified files: trunk/ChangeLog trunk/lib/yaml.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 40498) +++ ChangeLog (revision 40499) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Apr 27 23:25:00 2013 Zachary Scott <zachary@z...> + + * lib/yaml.rb: Documentation for YAML module [Bug #8213] + Sat Apr 27 20:19:21 2013 Tanaka Akira <akr@f...> * thread_pthread.c (ruby_init_stack): Add STACK_GROW_DIR_DETECTION. Index: lib/yaml.rb =================================================================== --- lib/yaml.rb (revision 40498) +++ lib/yaml.rb (revision 40499) @@ -12,7 +12,7 @@ rescue LoadError https://github.com/ruby/ruby/blob/trunk/lib/yaml.rb#L12 raise end -module Psych +module Psych # :nodoc: class EngineManager # Returns the YAML engine in use. # @@ -53,4 +53,27 @@ module Psych https://github.com/ruby/ruby/blob/trunk/lib/yaml.rb#L53 ENGINE = EngineManager.new # :nodoc: end +# YAML Ain't Markup Language +# +# This module provides a Ruby interface for data serialization in YAML format. +# +# The underlying implementation depends on an engine to handle the parsing and +# serialization for Ruby, by default this will be using the libyaml wrapper +# Psych. +# +# See Psych::EngineManager for details on switching the default YAML engine. +# +# Working with YAML can be very simple, for example: +# +# require 'yaml' # STEP ONE, REQUIRE YAML! +# # 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" +# +# For more advanced details on the implementation see Psych, and also check out +# yaml.org for spec details and other helpful information. +module YAML; end YAML = Psych -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/