4 # Attempts to require anative extension.
5 # Falls back to pure-ruby version, if it fails.
7 # This uses Config::CONFIG['arch'] from rbconfig.
9 def require_arch(fname
)
10 arch
= Config
::CONFIG['arch']
12 path
= File
.join("tmail", arch
, fname
)
15 # try pre-built Windows binaries
17 require File
.join("tmail", 'mswin32', fname
)
25 # def require_arch(fname)
26 # dext = Config::CONFIG['DLEXT']
28 # if File.extname(fname) == dext
31 # path = File.join("tmail","#{fname}.#{dext}")
34 # rescue LoadError => e
36 # arch = Config::CONFIG['arch']
37 # path = File.join("tmail", arch, "#{fname}.#{dext}")
42 # path.sub!('i686', 'i586')
44 # path.sub!('i586', 'i486')
46 # path.sub!('i486', 'i386')
49 # require fname + '.rb'