summaryrefslogtreecommitdiff
path: root/lib/rake/ext/time.rb
blob: 7877abf0cebee26663d0d598c6e8001a1cb2e5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#--
# Extensions to time to allow comparisons with an early time class.

class Time
  alias rake_original_time_compare :<=>
  def <=>(other)
    if Rake::EarlyTime === other
      - other.<=>(self)
    else
      rake_original_time_compare(other)
    end
  end
end