Skip to content

Commit d59a94f

Browse files
authored
Merge pull request #39 from luchihoratiu/MODULES-10852
(MODULES-10852) Fix warnings introduced by Ruby 2.7
2 parents 61d3b9b + ae6c349 commit d59a94f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/puppet/type/cron.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def insync?(is)
7373
# in string form to actual integers, and returns the value if it's
7474
# an integer or false if it's just a normal string.
7575
def numfix(num)
76-
if num =~ %r{^\d+$} || num.is_a?(Integer)
76+
if num.is_a?(Integer) || num =~ %r{^\d+$}
7777
num
7878
else
7979
false
@@ -155,17 +155,17 @@ def should=(ary)
155155
end
156156

157157
# Allow step syntax
158-
if value =~ %r{^\*/[0-9]+$}
158+
if value.to_s =~ %r{^\*/[0-9]+$}
159159
return value
160160
end
161161

162162
# Allow ranges
163-
if value =~ %r{^[0-9]+-[0-9]+$}
163+
if value.to_s =~ %r{^[0-9]+-[0-9]+$}
164164
return value
165165
end
166166

167167
# Allow ranges with step
168-
if value =~ %r{^[0-9]+-[0-9]+/[0-9]+$}
168+
if value.to_s =~ %r{^[0-9]+-[0-9]+/[0-9]+$}
169169
return value
170170
end
171171

0 commit comments

Comments
 (0)