From 4d8782abeca8421dbb906abf8fa325cd6f978528 Mon Sep 17 00:00:00 2001 From: Pablo Herrero Date: Sat, 30 May 2015 16:35:35 -0300 Subject: [PATCH] Remove unnecessary monkey patching --- lib/rake/ext/time.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/rake/ext/time.rb b/lib/rake/ext/time.rb index d3b8cf9dc..3c206e4dd 100644 --- a/lib/rake/ext/time.rb +++ b/lib/rake/ext/time.rb @@ -4,13 +4,15 @@ require 'rake/early_time' require 'rake/late_time' -class Time # :nodoc: all - alias rake_original_time_compare :<=> - def <=>(other) - if Rake::EarlyTime === other || Rake::LateTime === other - - other.<=>(self) - else - rake_original_time_compare(other) +if RUBY_VERSION < "1.9" + class Time # :nodoc: all + alias rake_original_time_compare :<=> + def <=>(other) + if Rake::EarlyTime === other || Rake::LateTime === other + - other.<=>(self) + else + rake_original_time_compare(other) + end end end end