lib/chronic/numerizer.rb in chronic-0.5.0 vs lib/chronic/numerizer.rb in chronic-0.6.0

- old
+ new

@@ -105,16 +105,17 @@ class << self private def andition(string) sc = StringScanner.new(string) - while(sc.scan_until(/<num>(\d+)( | and )<num>(\d+)(?=[^\w]|$)/i)) + + while sc.scan_until(/<num>(\d+)( | and )<num>(\d+)(?=[^\w]|$)/i) if sc[2] =~ /and/ || sc[1].size > sc[3].size string[(sc.pos - sc.matched_size)..(sc.pos-1)] = '<num>' + (sc[1].to_i + sc[3].to_i).to_s sc.reset end end end - end + end end end \ No newline at end of file