Created
August 10, 2010 12:58
-
-
Save bussiere/517221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#getting all the variable of a ruby file in a hash | |
result = Hash.new | |
file = File.new("betageneration.rb", "r") | |
while (line = file.gets) | |
if (line=~ / = /) != nil | |
result[line.split(/ = /)[0].to_s] = eval(line.split(/ = /)[1]) | |
end | |
end | |
file.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment