You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/puppet/settings/ttl_setting.rb
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -34,18 +34,17 @@ def print(value)
34
34
35
35
# Convert the value to Numeric, parsing numeric string with units if necessary.
36
36
defself.munge(value,param_name)
37
-
case
38
-
whenvalue.is_a?(Numeric)
37
+
ifvalue.is_a?(Numeric)
39
38
ifvalue < 0
40
39
raisePuppet::Settings::ValidationError,_("Invalid negative 'time to live' %{value} - did you mean 'unlimited'?") % {value: value.inspect}
41
40
end
42
41
43
42
value
44
43
45
-
whenvalue == 'unlimited'
44
+
elsifvalue == 'unlimited'
46
45
Float::INFINITY
47
46
48
-
when(value.is_a?(String)andvalue =~ FORMAT)
47
+
elsif(value.is_a?(String)andvalue =~ FORMAT)
49
48
$1.to_i * UNITMAP[$2 || 's']
50
49
else
51
50
raisePuppet::Settings::ValidationError,_("Invalid 'time to live' format '%{value}' for parameter: %{param_name}") % {value: value.inspect,param_name: param_name}
0 commit comments