如何写不同ruby版本下面兼容的程序

很简单,利用系统变量

requir "enumerator" if RUBY_VERSION < "1.8.7"

你可能感兴趣的:(如何写不同ruby版本下面兼容的程序)