Skip to content

Commit 4d8782a

Browse files
committed
Remove unnecessary monkey patching
1 parent df402d6 commit 4d8782a

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

lib/rake/ext/time.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
require 'rake/early_time'
55
require 'rake/late_time'
66

7-
class Time # :nodoc: all
8-
alias rake_original_time_compare :<=>
9-
def <=>(other)
10-
if Rake::EarlyTime === other || Rake::LateTime === other
11-
- other.<=>(self)
12-
else
13-
rake_original_time_compare(other)
7+
if RUBY_VERSION < "1.9"
8+
class Time # :nodoc: all
9+
alias rake_original_time_compare :<=>
10+
def <=>(other)
11+
if Rake::EarlyTime === other || Rake::LateTime === other
12+
- other.<=>(self)
13+
else
14+
rake_original_time_compare(other)
15+
end
1416
end
1517
end
1618
end

0 commit comments

Comments
 (0)