Skip to content

Commit ef00ded

Browse files
Merge pull request #2102 from carabasdaniel/bool2httpdfix
Fix bool2httpd function call for older ruby versions
2 parents 4a084fc + fa9d54e commit ef00ded

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/puppet/functions/apache/bool2httpd.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ def bool2httpd(arg)
2525
private
2626

2727
def matches_string?(value, matcher)
28-
value.is_a?(String) && value.match?(matcher)
28+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.4.0')
29+
value =~ matcher
30+
else
31+
value.is_a?(String) && value.match?(matcher)
32+
end
2933
end
3034
end

0 commit comments

Comments
 (0)