JoshCheek / seeing_is_believing

Displays the results of every line of code in your file
1.31k stars 54 forks source link

Get off YAML *sigh* #36

Closed JoshCheek closed 10 years ago

JoshCheek commented 10 years ago

YAML cannot be used because it can't deal with hostile environments. Run this as normal Ruby (not SiB)

class Object
  def !(a)
  end
end

require 'yaml'
p YAML.load YAML.dump Object.new

blows up:

bug:2:in `!': wrong number of arguments (0 for 1) (ArgumentError)
    from /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:886:in `block in suffixes'
    from /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:884:in `map'
    from /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:884:in `suffixes'
    from /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems.rb:1091:in `find_unresolved_default_spec'
    from /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:43:in `require'
    from bug:6:in `<main>'