lib/chronic/handlers.rb in chronic-0.1.6 vs lib/chronic/handlers.rb in chronic-0.2.0

- old
+ new

@@ -212,20 +212,22 @@ end def handle_s_r_p(tokens, options) #:nodoc: repeater = tokens[1].get_tag(Repeater) - span = - case true - when [RepeaterYear, RepeaterSeason, RepeaterSeasonName, RepeaterMonth, RepeaterMonthName, RepeaterFortnight, RepeaterWeek].include?(repeater.class) - self.parse("this hour", :guess => false, :now => @now) - when [RepeaterWeekend, RepeaterDay, RepeaterDayName, RepeaterDayPortion, RepeaterHour].include?(repeater.class) - self.parse("this minute", :guess => false, :now => @now) - when [RepeaterMinute, RepeaterSecond].include?(repeater.class) - self.parse("this second", :guess => false, :now => @now) - else - raise(ChronicPain, "Invalid repeater: #{repeater.class}") - end + # span = + # case true + # when [RepeaterYear, RepeaterSeason, RepeaterSeasonName, RepeaterMonth, RepeaterMonthName, RepeaterFortnight, RepeaterWeek].include?(repeater.class) + # self.parse("this hour", :guess => false, :now => @now) + # when [RepeaterWeekend, RepeaterDay, RepeaterDayName, RepeaterDayPortion, RepeaterHour].include?(repeater.class) + # self.parse("this minute", :guess => false, :now => @now) + # when [RepeaterMinute, RepeaterSecond].include?(repeater.class) + # self.parse("this second", :guess => false, :now => @now) + # else + # raise(ChronicPain, "Invalid repeater: #{repeater.class}") + # end + + span = self.parse("this second", :guess => false, :now => @now) self.handle_srp(tokens, span, options) end def handle_p_s_r(tokens, options) #:nodoc: \ No newline at end of file