diff options
| author | Luke Kanies <luke@madstop.com> | 2008-07-08 15:03:13 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-07-08 15:03:13 -0500 |
| commit | c1dc92b9a14c04096e0bed0f2c4acc4dfe1ed7d2 (patch) | |
| tree | b3269b4e76edbcb3458fcdf1832421fb11e57890 /lib/puppet/parser | |
| parent | b0febd263c0cb8e61d512898f7c79868ea77e619 (diff) | |
| parent | edf99c508dabb58342eeff251ad5701d2755426d (diff) | |
Merge branch '0.24.x'
Conflicts:
CHANGELOG
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/ast/function.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/parser/functions.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index 63d7c7abf..eb36fa906 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -42,7 +42,7 @@ class Puppet::Parser::AST raise Puppet::DevError, "Invalid function type %s" % @ftype.inspect end - # Lastly, check the arity + # Lastly, check the parity end end end diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index 8decb8227..51903e919 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -317,6 +317,14 @@ module Functions end output end + + newfunction(:sha1, :type => :rvalue, + :doc => "Returns a SHA1 hash value from a provided string.") do |args| + require 'sha1' + + Digest::SHA1.hexdigest(args[0]) + end + end end |
