summaryrefslogtreecommitdiff
path: root/str2bool.rb
diff options
context:
space:
mode:
authorKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>2011-04-29 23:30:32 +0100
committerKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>2011-04-29 23:30:32 +0100
commit0ff8b00a64426acf96d0659d1cbc1f67bba842f4 (patch)
tree34c846c222a34df5059e618be48a3585d9a78458 /str2bool.rb
parent726746649e38615b69aa372ec978b2ffa39b89d5 (diff)
downloadpuppet-stdlib-0ff8b00a64426acf96d0659d1cbc1f67bba842f4.tar.gz
puppet-stdlib-0ff8b00a64426acf96d0659d1cbc1f67bba842f4.tar.bz2
Small re-factor. Changed if not to unless for code clarity.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Diffstat (limited to 'str2bool.rb')
-rw-r--r--str2bool.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/str2bool.rb b/str2bool.rb
index 02b5aae..5a52f25 100644
--- a/str2bool.rb
+++ b/str2bool.rb
@@ -12,11 +12,12 @@ module Puppet::Parser::Functions
string = arguments[0]
- if not string.is_a?(String)
- raise(Puppet::ParseError, 'str2bool(): Requires either a ' +
+ unless string.is_a?(String)
+ raise(Puppet::ParseError, 'str2bool(): Requires either ' +
'string to work with')
end
+ # We consider all the yes, no, y, n and so on too ...
result = case string
#
# This is how undef looks like in Puppet ...