summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/str2bool.rb
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-01-13 12:41:58 +0100
committervarac <varacanero@zeromail.org>2017-01-13 12:41:58 +0100
commit066c08f8362d53f0f30897cb8710d11260c726ea (patch)
treea6369eecd88bb731fe413d0bbc8af73d74d1f447 /lib/puppet/parser/functions/str2bool.rb
parent71123634744b9fe2ec7d6a3e38e9789fd84801e3 (diff)
parentb65dd1f45d10e10e45455358aeabb29167990e2c (diff)
Merge remote-tracking branch 'origin/master' into leap_master
Diffstat (limited to 'lib/puppet/parser/functions/str2bool.rb')
-rw-r--r--lib/puppet/parser/functions/str2bool.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/parser/functions/str2bool.rb b/lib/puppet/parser/functions/str2bool.rb
index 446732e..472506d 100644
--- a/lib/puppet/parser/functions/str2bool.rb
+++ b/lib/puppet/parser/functions/str2bool.rb
@@ -5,8 +5,8 @@
module Puppet::Parser::Functions
newfunction(:str2bool, :type => :rvalue, :doc => <<-EOS
This converts a string to a boolean. This attempt to convert strings that
-contain things like: y, 1, t, true to 'true' and strings that contain things
-like: 0, f, n, false, no to 'false'.
+contain things like: Y,y, 1, T,t, TRUE,true to 'true' and strings that contain things
+like: 0, F,f, N,n, false, FALSE, no to 'false'.
EOS
) do |arguments|
@@ -21,7 +21,7 @@ like: 0, f, n, false, no to 'false'.
end
unless string.is_a?(String)
- raise(Puppet::ParseError, 'str2bool(): Requires either ' +
+ raise(Puppet::ParseError, 'str2bool(): Requires ' +
'string to work with')
end
@@ -32,8 +32,8 @@ like: 0, f, n, false, no to 'false'.
# We yield false in this case.
#
when /^$/, '' then false # Empty string will be false ...
- when /^(1|t|y|true|yes)$/ then true
- when /^(0|f|n|false|no)$/ then false
+ when /^(1|t|y|true|yes)$/i then true
+ when /^(0|f|n|false|no)$/i then false
when /^(undef|undefined)$/ then false # This is not likely to happen ...
else
raise(Puppet::ParseError, 'str2bool(): Unknown type of boolean given')