12 Oct
2009
12 Oct
'09
2:42 a.m.
At the line around 100 of bin/rubyc:
init_func = "MREP_#{File.read(path).hash}"
I extracted this line and execute it with -e option
$ ./miniruby -I. -I./lib -e "p File.read('rbconfig.rb').hash" -107041289
I suppose that String#hash method will return an integer, that could be nagative value. I don't know why on other environments the method return positive value everytime...
Laurent, wouldn't it be better to use something like a SHA1: require 'digest/sha1' init_func = "MREP_#{Digest::SHA1.hexdigest(File.read(path))}"