lib/si/patch.rb in si-0.1.4 vs lib/si/patch.rb in si-0.2.0
- old
+ new
@@ -1,15 +1,13 @@
-class Float
- include SI
-end
+original_verbosity = $VERBOSE
-class Fixnum
- include SI
-end
+$VERBOSE = nil
-class Bignum
- include SI
-end
+['Float', 'Fixnum', 'Bignum', 'Rational', 'Integer'].each do |const|
+ next unless Object.const_defined?(const)
-class Rational
- include SI
+ Object.const_get(const).class_eval do
+ include SI
+ end
end
+
+$VERBOSE = original_verbosity