Skip to content

Commit

Permalink
Merge pull request #686 from ruby/lazily-load-stringio
Browse files Browse the repository at this point in the history
Make to load stringio lazily
  • Loading branch information
hsbt authored Sep 9, 2024
2 parents 8948a06 + 9f5392d commit 47aecb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/psych/nodes/node.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# frozen_string_literal: true
require 'stringio'
require_relative '../class_loader'
require_relative '../scalar_scanner'

Expand Down Expand Up @@ -56,6 +55,7 @@ def to_ruby(symbolize_names: false, freeze: false, strict_integer: false)
#
# See also Psych::Visitors::Emitter
def yaml io = nil, options = {}
require "stringio"
real_io = io || StringIO.new(''.encode('utf-8'))

Visitors::Emitter.new(real_io, options).accept self
Expand Down

0 comments on commit 47aecb4

Please sign in to comment.