lib/ruby_ext/prepare_arguments.rb in ruby-ext-0.2.0 vs lib/ruby_ext/prepare_arguments.rb in ruby-ext-0.2.1
- old
+ new
@@ -85,20 +85,20 @@
a
end
end
end
-class Object
- def self.prepare_arguments_for method, *args
+Module.class_eval do
+ def prepare_arguments_for method, *args
# Register parsers
ArgumentsParser.register method, args
-
+
# Wrap method
old_method = :"#{method}_wparg"
alias_method old_method, method
code = <<END
def #{method} *args, &block
- #{old_method} *ArgumentsParser.parse_arguments_for(:#{method}, *args), &block
+#{old_method} *ArgumentsParser.parse_arguments_for(:#{method}, *args), &block
end
END
class_eval code, __FILE__, __LINE__
end
end
\ No newline at end of file