-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from jordiprats/master
yesno2bool
- Loading branch information
Showing
8 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## 0.1.12 | ||
|
||
* added **yesno2bool** function | ||
|
||
## 0.1.11 | ||
|
||
* added **git clone** type to clone repos | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# shamesly stolen from: https://github.com/puppetlabs/puppetlabs-apache/blob/master/lib/puppet/parser/functions/bool2httpd.rb | ||
# with minor changes | ||
# | ||
# | ||
#Copyright (C) 2012 Puppet Labs Inc | ||
# | ||
#Puppet Labs can be contacted at: [email protected] | ||
# | ||
#Licensed under the Apache License, Version 2.0 (the "License"); | ||
# | ||
# | ||
Puppet::Parser::Functions::newfunction(:yesno2bool, :type => :rvalue, :doc => <<-EOS | ||
Transform a supposed string ('yes', 'true' or 'no', 'false') to a bool (true or false). | ||
Unexpected values will return true and nil value (undef) will return false | ||
EOS | ||
) do |args| | ||
raise(Puppet::ParseError, "bool2yesno() wrong number of arguments. #{args.size} vs 1)") if args.size != 1 | ||
|
||
arg = args[0] | ||
|
||
if arg.nil? or arg == false or arg =~ /false/i or arg =~ /no/i or arg == :undef | ||
return false | ||
else | ||
return true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters