engines/adva_newsletter/vendor/gems/cronedit-0.3.0/lib/cronedit.rb
def parse_field str, first, last
            list = str.split(",")
            list.map!{|r|
                r, every = r.split("/")
                every = every ? every.to_i : 1
                f,l = r.split("-")
                range = if f == "*"
                        first..last
                    elsif l.nil?
                        f.to_i .. f.to_i
                    elsif f.to_i < first
                        raise FormatError.new( "out of range (#{f} for #{first})")
                    elsif last < l.to_i
                        raise FormatError.new( "out of range (#{l} for #{last})")
                    else
                        f.to_i .. l.to_i
                  end
                range.to_a.find_all{|i| (i - first) % every == 0}
            }
            list.flatten!
            list.join ','
        end
# Original author of parsing: gotoken@notwork.org
Original author of parsing: gotoken@notwork.org
Original author of parsing : gotoken@notwork . org
def parse_field str, first, last
            list = str.split(",")
            list.map!{|r|
                r, every = r.split("/")
                every = every ? every.to_i : 1
                f,l = r.split("-")
                range = if f == "*"
                        first..last
                    elsif l.nil?
                        f.to_i .. f.to_i
                    elsif f.to_i < first
                        raise FormatError.new( "out of range (#{f} for #{first})")
                    elsif last < l.to_i
                        raise FormatError.new( "out of range (#{l} for #{last})")
                    else
                        f.to_i .. l.to_i
                  end
                range.to_a.find_all{|i| (i - first) % every == 0}
            }
            list.flatten!
            list.join ','
        end
def parse_field str , first , last list = str . split ( "," ) list . map! { | r | r , every = r . split ( "/" ) every = every ? every . to_i : 1 f , l = r . split ( "-" ) range = if f == "*" first .. last elsif l . nil? f . to_i .. f . to_i elsif f . to_i < first raise FormatError . new ( "out of range (#{f} for #{first})" ) elsif last < l . to_i raise FormatError . new ( "out of range (#{l} for #{last})" ) else f . to_i .. l . to_i end range . to_a . find_all { | i | ( i - first ) % every == 0 } } list . flatten! list . join ',' end
Original author of parsing: gotoken@notwork.org
Original author of parsing : gotoken@notwork . org
str
first
last