From c86b2eda9caaadd28a83b598986482fba19eb923 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Thu, 5 Nov 2020 15:49:33 -0600 Subject: [PATCH 1/6] Enhanced RDoc for psych.rb --- lib/psych.rb | 138 +++++++++++++++++++++------------------------------ 1 file changed, 56 insertions(+), 82 deletions(-) diff --git a/lib/psych.rb b/lib/psych.rb index b09866ad..4c8f5fbd 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -31,10 +31,9 @@ ### # = Overview # -# Psych is a YAML parser and emitter. -# Psych leverages libyaml [Home page: https://pyyaml.org/wiki/LibYAML] -# or [HG repo: https://bitbucket.org/xi/libyaml] for its YAML parsing -# and emitting capabilities. In addition to wrapping libyaml, Psych also +# \Psych is a \YAML parser and emitter. +# Psych leverages {LibYAML}[https://pyyaml.org/wiki/LibYAML] for its \YAML parsing +# and emitting capabilities. In addition to wrapping LibYAML, \Psych also # knows how to serialize and de-serialize most Ruby objects to and from # the YAML format. # @@ -49,71 +48,41 @@ # # Got more time on your hands? Keep on reading! # -# == YAML Parsing -# -# Psych provides a range of interfaces for parsing a YAML document ranging from -# low level to high level, depending on your parsing needs. At the lowest -# level, is an event based parser. Mid level is access to the raw YAML AST, -# and at the highest level is the ability to unmarshal YAML to Ruby objects. -# -# == YAML Emitting -# -# Psych provides a range of interfaces ranging from low to high level for -# producing YAML documents. Very similar to the YAML parsing interfaces, Psych -# provides at the lowest level, an event based system, mid-level is building -# a YAML AST, and the highest level is converting a Ruby object straight to -# a YAML document. +# \Psych provides a range of interfaces for parsing and emitting \YAML: +# - {High-level API}[#module-Psych-label-High-level+API]: ability to convert directly between \YAML and Ruby objects. +# - {Mid-level API}[#module-Psych-label-Mid-level+API]: access to the raw \YAML AST (Abstract Syntax Tree). +# - {Low-level API}[#module-Psych-label-Low-level+API]: access to the event-based parser and emitter. # # == High-level API # -# === Parsing -# -# The high level YAML parser provided by Psych simply takes YAML as input and -# returns a Ruby data structure. For information on using the high level parser -# see Psych.load +# The high-level \Psych API supports direct conversion between \YAML and Ruby objects. # -# ==== Reading from a string -# -# Psych.load("--- a") # => 'a' -# Psych.load("---\n - a\n - b") # => ['a', 'b'] -# -# ==== Reading from a file +# === Parsing # -# Psych.load_file("database.yml") +# Use method Psych.load to convert a \YAML \String to Ruby objects: +# Psych.load('--- a') # => "a" +# Psych.load("---\n - a\n - b") # => ["a", "b"] # -# ==== Exception handling -# -# begin -# # The second argument changes only the exception contents -# Psych.parse("--- `", "file.txt") -# rescue Psych::SyntaxError => ex -# ex.file # => 'file.txt' -# ex.message # => "(file.txt): found character that cannot start any token" -# end +# Use method Psych.load_file to parse \File content to Ruby objects: +# File.write('t.yml', '--- a') +# Psych.load_file('t.yml') # => "a" # # === Emitting # -# The high level emitter has the easiest interface. Psych simply takes a Ruby -# data structure and converts it to a YAML document. See Psych.dump for more -# information on dumping a Ruby data structure. -# -# ==== Writing to a string +# Use method Psych.dump to convert Ruby objects to a \YAML \String: +# Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" # -# # Dump an array, get back a YAML string -# Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" -# -# # Dump an array to an IO object -# Psych.dump(['a', 'b'], StringIO.new) # => # -# -# # Dump an array with indentation set -# Psych.dump(['a', ['b']], :indentation => 3) # => "---\n- a\n- - b\n" -# -# # Dump an array to an IO with indentation set -# Psych.dump(['a', ['b']], StringIO.new, :indentation => 3) +# An optional second argument can direct the output to an \IO stream: +# File.open('t.yml', 'w') do |file| +# Psych.dump(['a', 'b'], file) +# end +# File.read('t.yml') # => "---\n- a\n- b\n" # -# ==== Writing to a file +# There are options available for formatting the \YAML output. +# See Psych.dump. # -# Currently there is no direct API for dumping Ruby structure to file: +# There is no direct API for dumping \YAML data to a file, +# but you can do this: # # File.open('database.yml', 'w') do |file| # file.write(Psych.dump(['a', 'b'])) @@ -235,39 +204,44 @@ module Psych NOT_GIVEN = Object.new private_constant :NOT_GIVEN - ### - # Load +yaml+ in to a Ruby data structure. If multiple documents are - # provided, the object contained in the first document will be returned. - # +filename+ will be used in the exception message if any exception - # is raised while parsing. If +yaml+ is empty, it returns - # the specified +fallback+ return value, which defaults to +false+. + # :call-seq: + # Psych.load(yaml_string, **options) -> object # - # Raises a Psych::SyntaxError when a YAML syntax error is detected. + # Returns the Ruby object created by converting the given +yaml_string+ + # to a Ruby object: + # Psych.load('--- a') # => 'a' + # Psych.load("---\n - a\n - b") # => ['a', 'b'] # - # Example: + # Use option +fallback+ to specify a value to be returned if +yaml_string+ is empty; + # the default is +false+: + # Psych.load('') # => false + # Psych.load('', fallback: nil) # => nil # - # Psych.load("--- a") # => 'a' - # Psych.load("---\n - a\n - b") # => ['a', 'b'] + # Use option +symbolize_names+ to specify that \Hash keys should be Symbols; + # the default is +false+: + # Psych.load('foo: 0') # => {"foo"=>0} + # Psych.load('foo: 0', symbolize_names: true) # => {:foo=>0} + # + # Use option +freeze+ to specify that the returned object should be frozen; + # the default is +false+: + # Psych.load('--- a').frozen? # => false + # Psych.load('--- a', freeze: true).frozen? # => true # + # Use option +filename+ to specify a \String to be included in the message + # for a raised exception: + # the default is +nil+: # begin - # Psych.load("--- `", filename: "file.txt") + # Psych.load("--- `", filename: 'foo') # rescue Psych::SyntaxError => ex - # ex.file # => 'file.txt' - # ex.message # => "(file.txt): found character that cannot start any token" + # p ex.file + # p ex.message # end + # Output: + # "foo" + # "(foo): found character that cannot start any token while scanning for the next token at line 1 column 5" # - # When the optional +symbolize_names+ keyword argument is set to a - # true value, returns symbols for keys in Hash objects (default: strings). - # - # Psych.load("---\n foo: bar") # => {"foo"=>"bar"} - # Psych.load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"} - # - # Raises a TypeError when `yaml` parameter is NilClass - # - # NOTE: This method *should not* be used to parse untrusted documents, such as - # YAML documents that are supplied via user input. Instead, please use the - # safe_load method. - # + # Note: DO NOT use this method to parse untrusted documents, such as + # \YAML documents that are supplied via user input. Instead, use method Psych.safe_load. def self.load yaml, legacy_filename = NOT_GIVEN, filename: nil, fallback: false, symbolize_names: false, freeze: false if legacy_filename != NOT_GIVEN warn_with_uplevel 'Passing filename with the 2nd argument of Psych.load is deprecated. Use keyword argument like Psych.load(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE From 7772c0f84fa4c0319d7c4d371f880960c007ed50 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Fri, 6 Nov 2020 09:12:18 -0600 Subject: [PATCH 2/6] Enhanced RDoc for psych.rb --- lib/psych.rb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/psych.rb b/lib/psych.rb index 4c8f5fbd..8d69c444 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -28,14 +28,22 @@ require 'psych/handlers/document_stream' require 'psych/class_loader' -### +# = \YAML +# +# \YAML is a human- and machine-readable text format for data structures. +# +# Details available at website yaml.org: +# - {Specification for YAML version 1.2}[https://yaml.org/spec/1.2/spec.html]. +# - {Conversion}[https://yaml.org/YAML_for_ruby.html] between \YAML and Ruby. +# # = Overview # # \Psych is a \YAML parser and emitter. -# Psych leverages {LibYAML}[https://pyyaml.org/wiki/LibYAML] for its \YAML parsing -# and emitting capabilities. In addition to wrapping LibYAML, \Psych also -# knows how to serialize and de-serialize most Ruby objects to and from -# the YAML format. +# that leverages {LibYAML}[https://pyyaml.org/wiki/LibYAML] for its \YAML parsing +# and emitting capabilities: +# - \Psych parsing can de-serializes \YAML documents into Ruby objects. +# - \Psych emitting can serialize Ruby objects into \YAML documents. +# # # = I NEED TO PARSE OR EMIT YAML RIGHT NOW! # @@ -46,7 +54,7 @@ # Psych.dump("foo") # => "--- foo\n...\n" # { :a => 'b'}.to_yaml # => "---\n:a: b\n" # -# Got more time on your hands? Keep on reading! +# = \Psych # # \Psych provides a range of interfaces for parsing and emitting \YAML: # - {High-level API}[#module-Psych-label-High-level+API]: ability to convert directly between \YAML and Ruby objects. From 3e517e686fe84593c9922f569ca8949448daa0d5 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Fri, 6 Nov 2020 09:45:01 -0600 Subject: [PATCH 3/6] Enhanced RDoc for psych.rb --- lib/psych.rb | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/lib/psych.rb b/lib/psych.rb index 8d69c444..c139f681 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -67,34 +67,51 @@ # # === Parsing # +# Assume: +# yaml = <<-EOT +# --- +# - foo +# - bar +# - baz +# EOT +# # Use method Psych.load to convert a \YAML \String to Ruby objects: -# Psych.load('--- a') # => "a" -# Psych.load("---\n - a\n - b") # => ["a", "b"] +# Psych.load(yaml) # => ["foo", "bar", "baz"] # # Use method Psych.load_file to parse \File content to Ruby objects: -# File.write('t.yml', '--- a') -# Psych.load_file('t.yml') # => "a" +# File.write('t.yml', yaml) +# Psych.load_file('t.yml') # => ["foo", "bar", "baz"] +# +# There is also a method for parsing multiple \YAML documents in a single \String. +# See Psych.load_stream. # # === Emitting # +# Assume: +# ruby = ["foo", "bar", "baz"] +# # Use method Psych.dump to convert Ruby objects to a \YAML \String: -# Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" +# Psych.dump(ruby) # => "---\n- foo\n- bar\n- baz\n" # # An optional second argument can direct the output to an \IO stream: # File.open('t.yml', 'w') do |file| -# Psych.dump(['a', 'b'], file) +# Psych.dump(ruby, file) # end -# File.read('t.yml') # => "---\n- a\n- b\n" +# File.read('t.yml') # => "---\n- foo\n- bar\n- baz\n" # # There are options available for formatting the \YAML output. # See Psych.dump. # # There is no direct API for dumping \YAML data to a file, # but you can do this: -# -# File.open('database.yml', 'w') do |file| -# file.write(Psych.dump(['a', 'b'])) +# File.open('t.yml', 'w') do |file| +# file.write(Psych.dump(ruby)) # end +# File.read('t.yml') +# +# There is also a method for emitting multiple Ruby objects +# as separate \YAML documents in a single document stream. +# See Psych.dump_stream. # # == Mid-level API # From 1d056e8adabb9f3329d0f620f63a8a1ff1ad05d3 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Fri, 6 Nov 2020 15:30:20 -0600 Subject: [PATCH 4/6] Enhanced RDoc for psych.rb --- lib/psych.rb | 291 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 202 insertions(+), 89 deletions(-) diff --git a/lib/psych.rb b/lib/psych.rb index c139f681..8961e4cd 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -34,7 +34,7 @@ # # Details available at website yaml.org: # - {Specification for YAML version 1.2}[https://yaml.org/spec/1.2/spec.html]. -# - {Conversion}[https://yaml.org/YAML_for_ruby.html] between \YAML and Ruby. +# - {Details of conversions}[https://yaml.org/YAML_for_ruby.html] between \YAML and Ruby. # # = Overview # @@ -221,6 +221,116 @@ # # You can instantiate an Emitter manually # Psych::Visitors::ToRuby.new.accept(parser.handler.root.first) # # => "a" +# +# == Options for Parsing and Emitting +# +# === Options for Parsing +# +# ==== Option +fallback+ +# +# Use option +fallback+ to specify a value to be returned if +yaml_string+ is empty. +# +# Defaults: +# - Psych.load: +false+. +# - Psych.safe_load: +nil+. +# - Psych.load_stream: []. +# Examples: +# Psych.load('') # => false +# Psych.load('', fallback: nil) # => nil +# +# ==== Option +symbolize+ +# +# Use option +symbolize_names+ to specify that \Hash keys should be Symbols; +# the default is +false+: +# Psych.load('foo: 0') # => {"foo"=>0} +# Psych.load('foo: 0', symbolize_names: true) # => {:foo=>0} +# +# ==== Option +freeze+ +# +# Use option +freeze+ to specify that the returned object should be frozen; +# the default is +false+: +# Psych.load('--- a').frozen? # => false +# Psych.load('--- a', freeze: true).frozen? # => true +# +# ==== Option +filename+ +# +# Use option +filename+ to specify a \String to be included in the message +# for a raised exception: +# the default is +nil+: +# begin +# Psych.load("--- `", filename: 'foo') +# rescue Psych::SyntaxError => ex +# p ex.file +# p ex.message +# end +# Output: +# "foo" +# "(foo): found character that cannot start any token while scanning for the next token at line 1 column 5" +# +# === Options for Emitting +# +# ==== Option +indentation+ +# +# Use option +indentation+ to specify the number of spaces to be used for indentation; +# the default is 2: +# ruby = ['a', ['b']] +# puts Psych.dump(ruby) +# Output: +# --- +# - a +# - - b +# puts Psych.dump(ruby, indentation: 4) +# Output: +# --- +# - a +# - - b +# +# ==== Option +line_width+ +# +# Use option +line_width+ to specify the maximum line width; +# a line whose length exceeds that maximum will be wrapped; +# the default is 80: +# ruby = 'word ' * 16 +# puts Psych.dump(ruby, line_width: 20) +# Output: +# --- "word word word word +# word word word word +# word word word word +# word word word word " +# +# ==== Option +canonical+ +# +# Use option +canonical+ to specify that the \YAML output +# is to be in the very verbose canonical form; +# default is +false+: +# ruby = {a: {'b': 'c'}} +# puts Psych.dump(ruby) +# Output: +# --- +# :a: +# b: c +# puts Psych.dump(ruby, canonical: true) +# Output: +# --- +# { +# ? ! ":a" +# : { +# ? "b" +# : "c", +# }, +# } +# +# ==== Option +header+ +# +# Use option +header+ to specify that the \YAML version is to be included in the output; +# default is +false+: +# ruby = {a: {'b': 'c'}} +# puts Psych.dump(ruby, header: true) +# Output: +# %YAML 1.1 +# --- +# :a: +# :b: c module Psych # The version of libyaml Psych is using @@ -234,36 +344,15 @@ module Psych # # Returns the Ruby object created by converting the given +yaml_string+ # to a Ruby object: - # Psych.load('--- a') # => 'a' - # Psych.load("---\n - a\n - b") # => ['a', 'b'] - # - # Use option +fallback+ to specify a value to be returned if +yaml_string+ is empty; - # the default is +false+: - # Psych.load('') # => false - # Psych.load('', fallback: nil) # => nil - # - # Use option +symbolize_names+ to specify that \Hash keys should be Symbols; - # the default is +false+: - # Psych.load('foo: 0') # => {"foo"=>0} - # Psych.load('foo: 0', symbolize_names: true) # => {:foo=>0} - # - # Use option +freeze+ to specify that the returned object should be frozen; - # the default is +false+: - # Psych.load('--- a').frozen? # => false - # Psych.load('--- a', freeze: true).frozen? # => true - # - # Use option +filename+ to specify a \String to be included in the message - # for a raised exception: - # the default is +nil+: - # begin - # Psych.load("--- `", filename: 'foo') - # rescue Psych::SyntaxError => ex - # p ex.file - # p ex.message - # end - # Output: - # "foo" - # "(foo): found character that cannot start any token while scanning for the next token at line 1 column 5" + # yaml = <<-EOT + # --- + # - foo + # - bar + # - baz + # EOT + # Psych.load(yaml) # => ["foo", "bar", "baz"] + # + # For +options+, see {Options for Parsing}[#module-Psych-label-Options+for+Parsing]. # # Note: DO NOT use this method to parse untrusted documents, such as # \YAML documents that are supplied via user input. Instead, use method Psych.safe_load. @@ -460,46 +549,34 @@ def self.parse_stream yaml, legacy_filename = NOT_GIVEN, filename: nil, &block ### # call-seq: - # Psych.dump(o) -> string of yaml - # Psych.dump(o, options) -> string of yaml - # Psych.dump(o, io) -> io object passed in - # Psych.dump(o, io, options) -> io object passed in - # - # Dump Ruby object +o+ to a YAML string. Optional +options+ may be passed in - # to control the output format. If an IO object is passed in, the YAML will - # be dumped to that IO object. + # Psych.dump(object, **options) -> new_yaml_string + # Psych.dump(object, io, **options) -> given_io # - # Currently supported options are: + # For +options+, see {Options for Emitting}[#module-Psych-label-Options+for+Emitting]. # - # [:indentation] Number of space characters used to indent. - # Acceptable value should be in 0..9 range, - # otherwise option is ignored. + # Converts the given +object+ to a \YAML document. # - # Default: 2. - # [:line_width] Max character to wrap line at. - # - # Default: 0 (meaning "wrap at 81"). - # [:canonical] Write "canonical" YAML form (very verbose, yet - # strictly formal). - # - # Default: false. - # [:header] Write %YAML [version] at the beginning of document. - # - # Default: false. - # - # Example: - # - # # Dump an array, get back a YAML string - # Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" - # - # # Dump an array to an IO object - # Psych.dump(['a', 'b'], StringIO.new) # => # - # - # # Dump an array with indentation set - # Psych.dump(['a', ['b']], indentation: 3) # => "---\n- a\n- - b\n" - # - # # Dump an array to an IO with indentation set - # Psych.dump(['a', ['b']], StringIO.new, indentation: 3) + # With the single argument +object+, + # returns a new \String containing the \YAML document: + # ruby = ["foo", "bar", "baz"] + # puts Psych.dump(ruby) + # Output: + # --- + # - foo + # - bar + # - baz + # + # With arguments +object+ and an open \IO stream +io+, + # writes the \YAML document to that stream and returns the stream: + # File.open('t.yml', 'w') do |file| + # Psych.dump(ruby, file) + # end # => # + # puts File.read('t.yml') + # Output: + # --- + # - foo + # - bar + # - baz def self.dump o, io = nil, options = {} if Hash === io options = io @@ -511,12 +588,23 @@ def self.dump o, io = nil, options = {} visitor.tree.yaml io, options end - ### - # Dump a list of objects as separate documents to a document stream. + # :call-seq: + # Psych.dump_stream(*objects) -> new_yaml_string # - # Example: + # For +options+, see {Options for Emitting}[#module-Psych-label-Options+for+Emitting]. # - # Psych.dump_stream("foo\n ", {}) # => "--- ! \"foo\\n \"\n--- {}\n" + # Returns a new \String containing the \YAML documents created by converting + # the given +objects+: + # array = [:foo, :bar] + # hash = {baz: 0, bat: 1} + # puts Psych.dump_stream(array, hash) + # Output: + # --- + # - :foo + # - :bar + # --- + # :baz: 0 + # :bat: 1 def self.dump_stream *objects visitor = Psych::Visitors::YAMLTree.create({}) objects.each do |o| @@ -533,21 +621,35 @@ def self.to_json object visitor.tree.yaml end - ### - # Load multiple documents given in +yaml+. Returns the parsed documents - # as a list. If a block is given, each document will be converted to Ruby - # and passed to the block during parsing - # - # Example: - # - # Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar'] - # + # :call-seq: + # Psych.load_stream(yaml_string, **options) -> new_array + # Psych.load_stream(yaml_string, **options) {|object| ... } -> new_array + # + # Returns a new \Array containing one element for each \YAML document + # found in +yaml_string+. + # Each element is the object created by converting a \YAML document. + # + # For +options+, see {Options for Parsing}[#module-Psych-label-Options+for+Parsing]. + # + # With no block given, + # returns the \Array of unmodified Ruby objects: + # yaml = <<-EOT + # --- + # - foo + # - bar + # --- + # - baz + # - bat + # EOT + # Psych.load_stream(yaml) # => [["foo", "bar"], ["baz", "bat"]] + # + # With a block given, calls the block with each created Ruby object; + # returns a Psych::Parser object: # list = [] - # Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby| - # list << ruby + # Psych.load_stream(yaml) do |object| + # list << object.reverse # end - # list # => ['foo', 'bar'] - # + # list # => [["bar", "foo"], ["bat", "baz"]] def self.load_stream yaml, legacy_filename = NOT_GIVEN, filename: nil, fallback: [], **kwargs if legacy_filename != NOT_GIVEN warn_with_uplevel 'Passing filename with the 2nd argument of Psych.load_stream is deprecated. Use keyword argument like Psych.load_stream(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE @@ -566,10 +668,21 @@ def self.load_stream yaml, legacy_filename = NOT_GIVEN, filename: nil, fallback: result end - ### - # Load the document contained in +filename+. Returns the yaml contained in - # +filename+ as a Ruby object, or if the file is empty, it returns - # the specified +fallback+ return value, which defaults to +false+. + # :call-seq: + # Psych.load_file(file_path, **options) -> object + # + # For +options+, see {Options for Parsing}[#module-Psych-label-Options+for+Parsing]. + # + # Returns the Ruby object created by converting the content of the specified file + # to a Ruby object: + # yaml = <<-EOT + # --- + # - foo + # - bar + # - baz + # EOT + # File.write('t.yml', yaml) + # Psych.load_file('t.yml') # => ["foo", "bar", "baz"] # => ["foo", "bar", "baz"] def self.load_file filename, **kwargs File.open(filename, 'r:bom|utf-8') { |f| self.load f, filename: filename, **kwargs From 3487a8565f92aa4a5a8c487d67d33ea5dd0ea041 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Mon, 10 May 2021 09:27:38 -0500 Subject: [PATCH 5/6] Update lib/psych.rb Co-authored-by: Olle Jonsson --- lib/psych.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/psych.rb b/lib/psych.rb index 3374a889..139232d8 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -41,7 +41,7 @@ # \Psych is a \YAML parser and emitter. # that leverages {LibYAML}[https://pyyaml.org/wiki/LibYAML] for its \YAML parsing # and emitting capabilities: -# - \Psych parsing can de-serializes \YAML documents into Ruby objects. +# - \Psych parsing can de-serialize \YAML documents into Ruby objects. # - \Psych emitting can serialize Ruby objects into \YAML documents. # # From 98ef0fe96ea55a743869f8e37790e043ddfc4ee3 Mon Sep 17 00:00:00 2001 From: Burdette Lamar Date: Mon, 10 May 2021 09:28:00 -0500 Subject: [PATCH 6/6] Update lib/psych.rb Co-authored-by: Olle Jonsson --- lib/psych.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/psych.rb b/lib/psych.rb index 139232d8..6f880fb1 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -238,7 +238,7 @@ # Psych.load('') # => false # Psych.load('', fallback: nil) # => nil # -# ==== Option +symbolize+ +# ==== Option +symbolize_names+ # # Use option +symbolize_names+ to specify that \Hash keys should be Symbols; # the default is +false+: