duplicated require of '.so' files?
We are trying to get rid of autoload;
We could require everything in the first line of the file but instead we
prefer to require only what we need, when we need it.
So, instead of
we would like to do:
The problem we've found, is that duplicate
require(name), satisfied by
".rb" files are only executed once; but when file loaded by
require(name) is a '.so', next requires with the same name will be
executed again and again.
$ cat require-rb.rb
$ strace -e trace=file -o require-rb.log ruby require-rb.rb
$ grep -c -E 'open.*/set' require-rb.log
$ cat require-so.rb
$ strace -e trace=file -o require-so.log ruby require-so.rb
$ grep -c -E 'open.*/md5' require-so.log
Is this a bug or a feature?