lib/rufus/sc/cronline.rb in rufus-scheduler-2.0.12 vs lib/rufus/sc/cronline.rb in rufus-scheduler-2.0.13
- old
+ new
@@ -188,10 +188,11 @@
raise ArgumentError.new(
"ranges are not supported for monthdays (#{it})"
) if it.index('-')
(monthdays ||= []) << it
+
else
WEEKDAYS.each_with_index { |a, i| it.gsub!(/#{a}/, i.to_s) }
its = it.index('-') ? parse_range(it, 0, 7) : [ Integer(it) ]
@@ -210,11 +211,11 @@
return nil if item == '*'
return parse_list(item, min, max) if item.index(',')
return parse_range(item, min, max) if item.index('*') or item.index('-')
- i = Integer(item)
+ i = item.to_i
i = min if i < min
i = max if i > max
[ i ]
@@ -232,22 +233,22 @@
i = item.index('-')
j = item.index('/')
return item.to_i if (not i and not j)
- inc = j ? Integer(item[j+1..-1]) : 1
+ inc = j ? item[j + 1..-1].to_i : 1
istart = -1
iend = -1
if i
- istart = Integer(item[0..i - 1])
+ istart = item[0..i - 1].to_i
- if j
- iend = Integer(item[i + 1..j - 1])
+ iend = if j
+ item[i + 1..j - 1].to_i
else
- iend = Integer(item[i + 1..-1])
+ item[i + 1..-1].to_i
end
else # case */x
istart = min