Updated with Rubinius Support

This commit is contained in:
Jim Weirich
2010-12-25 08:11:31 -05:00
parent db3bbdcf45
commit 3ce23a8ee0
4 changed files with 23 additions and 16 deletions

View File

@@ -13,13 +13,18 @@ end
def ruby_version?(version)
RUBY_VERSION =~ /^#{version}/ ||
(version == 'jruby' && defined?(JRUBY_VERSION)) ||
(version == 'mri' && ! defined?(JRUBY_VERSION))
(version == 'mri' && (! defined?(JRUBY_VERSION) && ! defined?(Rubinius))) ||
(version == 'rbx' && defined?(Rubinius))
end
def in_ruby_version(*versions)
yield if versions.any? { |v| ruby_version?(v) }
end
def not_in_ruby_version(*versions)
yield unless versions.any? { |v| ruby_version?(v) }
end
# Standard, generic replacement value.
# If value19 is given, it is used inplace of value for Ruby 1.9.
def __(value="FILL ME IN", value19=:mu)
@@ -52,7 +57,7 @@ class Object
end
end
in_ruby_version("1.9") do
in_ruby_version("1.9", "rbx") do
public :method_missing
end
end