aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDorin-Pleava <50825207+Dorin-Pleava@users.noreply.github.com>2020-10-30 12:41:22 +0200
committerGitHub <noreply@github.com>2020-10-30 12:41:22 +0200
commitd59a94fe4b80bc0a31e60710eca06f6d95d1f822 (patch)
tree8e4f762907777e1ab2ba78224a280c9b431bd595
parent61d3b9bf8f76bba66f3f93bff14d1f79e1099d1f (diff)
parentae6c3499669c11aa3a7bd5b021ac64c033a2bed9 (diff)
downloadpuppet-cron_core-d59a94fe4b80bc0a31e60710eca06f6d95d1f822.tar.gz
puppet-cron_core-d59a94fe4b80bc0a31e60710eca06f6d95d1f822.tar.bz2
Merge pull request #39 from luchihoratiu/MODULES-10852
(MODULES-10852) Fix warnings introduced by Ruby 2.7
-rw-r--r--lib/puppet/type/cron.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb
index 186a5e7..a536410 100644
--- a/lib/puppet/type/cron.rb
+++ b/lib/puppet/type/cron.rb
@@ -73,7 +73,7 @@ Puppet::Type.newtype(:cron) do
# in string form to actual integers, and returns the value if it's
# an integer or false if it's just a normal string.
def numfix(num)
- if num =~ %r{^\d+$} || num.is_a?(Integer)
+ if num.is_a?(Integer) || num =~ %r{^\d+$}
num
else
false
@@ -155,17 +155,17 @@ Puppet::Type.newtype(:cron) do
end
# Allow step syntax
- if value =~ %r{^\*/[0-9]+$}
+ if value.to_s =~ %r{^\*/[0-9]+$}
return value
end
# Allow ranges
- if value =~ %r{^[0-9]+-[0-9]+$}
+ if value.to_s =~ %r{^[0-9]+-[0-9]+$}
return value
end
# Allow ranges with step
- if value =~ %r{^[0-9]+-[0-9]+/[0-9]+$}
+ if value.to_s =~ %r{^[0-9]+-[0-9]+/[0-9]+$}
return value
end