Skip to content

Instantly share code, notes, and snippets.

@ip2k
Created September 27, 2011 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ip2k/1244249 to your computer and use it in GitHub Desktop.
Save ip2k/1244249 to your computer and use it in GitHub Desktop.
possible ruby bug
#!/usr/bin/env ruby
require 'yaml'
hashy = Hash["a" => 100, "b" => 200]
puts hashy.inspect
YAML::dump(hashy, File.open('test.yaml', 'w'))
puts YAML::load_file('test.yaml') # attempt 1
File.open( 'test.yaml' ) { |yf| puts YAML::load( yf ) } # attempt 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment