I recently try to fix some bugs of SciRuby, and found that in extconf.rb
it tries to detect the Ruby version and do different work, like this:
if RUBY_VERSION >= '2.0'
hfiles.puts "#define RUBY_2 1"
end
if RUBY_VERSION < '1.9.3'
hfiles.puts "#define OLD_RB_SCAN_ARGS"
end
in fact, is there a much better way to implement this? I found this one is weak and not so friendly.