On 4/21/07, Ari Brown <ari / aribrown.com> wrote: > > On Apr 20, 2007, at 10:20 PM, james.d.masters / gmail.com wrote: > > The code that cause this issue would be nice... but it looks like you > > are calling it from an Object something like this: > > > > a = Object.new > > a.yaml_save > > The code I'm using is this: > > require 'yaml.rb' > > filename = 'fun.txt' > test_array = ['hey', > 'look', > 'zoo'] > > yaml_save test_array, filename > > read_array = yaml_load filename > > puts(read_array == test_array) > > The yaml.rb code is: > > require 'yaml' > > def yaml_save object, filename > File.open filename, 'w' do |f| > f.write(object.to_yaml) > end > end > > def yaml_load filename > yaml_string = File.read filename > > YAML::load yaml_string > end > You should really use, some other name for your library because as pointed Alex, its in conflict with ruby standard library.