lib/fugit/parse.rb in fugit-0.9.6 vs lib/fugit/parse.rb in fugit-1.0.0
- old
+ new
@@ -1,17 +1,16 @@
module Fugit
def self.parse_at(s)
- Time.parse(s) rescue nil
+ ::EtOrbi.make_time(s) rescue nil
end
def self.do_parse_at(s)
- return s if s.is_a?(Time)
- Time.parse(s)
+ ::EtOrbi.make_time(s)
end
def self.parse_cron(s); ::Fugit::Cron.parse(s); end
def self.parse_duration(s); ::Fugit::Duration.parse(s); end
def self.parse_in(s); parse_duration(s); end
@@ -40,13 +39,13 @@
end
def self.determine_type(s)
case self.parse(s)
- when ::Time then 'at'
- when ::Fugit::Cron then 'cron'
- when ::Fugit::Duration then 'in'
- else nil
+ when ::Fugit::Cron then 'cron'
+ when ::Fugit::Duration then 'in'
+ when ::Time, ::EtOrbi::EoTime then 'at'
+ else nil
end
end
end