Add support for Ruby < 1.9

This commit is contained in:
Daniel Hilgarth 2013-03-03 15:12:21 +01:00
parent cc83501489
commit ce8e1afba6
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,9 @@ module Jekyll
# #
# Returns -1, 0, 1 # Returns -1, 0, 1
def <=>(other) def <=>(other)
cmp = self.date.to_date <=> other.date.to_date cmp = self.date.year <=> other.date.year
cmp = self.date.month <=> other.date.month if cmp == 0
cmp = self.date.day <=> other.date.day if cmp == 0
if 0 == cmp if 0 == cmp
cmp = self.slug <=> other.slug cmp = self.slug <=> other.slug
end end