cheezy/data_magic — Issue #1: DataMagic.data_for method throwing 'Can't convert String into Hash' error
Author: twinkston
Created: 2012-02-14 20:02:32+00:00
State: open

However, changing the data_for and prep_data methods made it work for me:
Please let me know if I am incorrectly regarding this as an issue and if these changes are unnecessary. Thank you.

In data_for method, replace the line
data = DataMagic.yml[key]
with
data = Hash[key, DataMagic.yml[key]]

In prep_data method, add the line,
puts data[key]
after the line,
data[key] = eval(value[1..-1]) if value[0] == "~"

AND, comment the line,
data
which appears the before the last end command.

So, my prep_data looks like this after these changes -

def prep_data(data)
data.each do |key, value|
unless value.nil?
data[key] = eval(value[1..-1]) if value[0] == "~"
puts data[key]
end
end
#data
end