You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I understand, safe_yaml does not support the load_stream method (or any form of YAML steam loading).
require "safe_yaml"
# File.open "bla.yaml" do |f|
# YAML.load_stream(f, :safe=>truew)
# end
v = <<EOF
--- !ruby/hash:ClassBuilder
"foo; end; puts %(I'm in yr system!); def bar": "baz"
---
EOF
puts "Load\n\n"
puts(YAML.load(v))
puts "\nLoad stream\n\n"
puts(YAML.load_stream(v))
Gives:
Load
Called 'load' without the :safe option -- defaulting to safe mode.
You can avoid this warning in the future by setting the SafeYAML::OPTIONS[:default_mode] option (to :safe or :unsafe).
{"foo; end; puts %(I'm in yr system!); def bar"=>"baz"}
Load stream
/usr/lib/ruby/2.1.0/psych/class_loader.rb:53:in `path2class': undefined class/module ClassBuilder (ArgumentError)
from /usr/lib/ruby/2.1.0/psych/class_loader.rb:53:in `resolve'
from /usr/lib/ruby/2.1.0/psych/class_loader.rb:45:in `find'
from /usr/lib/ruby/2.1.0/psych/class_loader.rb:27:in `load'
from /usr/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:360:in `resolve_class'
from /usr/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:261:in `visit_Psych_Nodes_Mapping'
from /usr/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
from /usr/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
from /usr/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
from /usr/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:276:in `visit_Psych_Nodes_Document'
from /usr/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
from /usr/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
from /usr/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
from /usr/lib/ruby/2.1.0/psych/nodes/node.rb:37:in `to_ruby'
from /usr/lib/ruby/2.1.0/psych.rb:456:in `block in load_stream'
from /usr/lib/ruby/2.1.0/psych.rb:456:in `map'
from /usr/lib/ruby/2.1.0/psych.rb:456:in `load_stream'
from test.rb:19:in `'
The text was updated successfully, but these errors were encountered:
As far as I understand, safe_yaml does not support the
load_stream
method (or any form of YAML steam loading).Gives:
The text was updated successfully, but these errors were encountered: