diff options
author | Ken Barber <ken@bob.sh> | 2011-07-29 00:10:31 +0100 |
---|---|---|
committer | Ken Barber <ken@bob.sh> | 2011-07-29 00:10:31 +0100 |
commit | ce48eb6e7a76f74e1f61c76ac3b185031c40772b (patch) | |
tree | dbb7d442fe1678a7bb208b395e0acf58e7357d5a /lib/puppet/parser/functions | |
parent | 7d6ae5d57ce45ff1293f02b90c816a7f938a3af6 (diff) | |
download | puppet-stdlib-ce48eb6e7a76f74e1f61c76ac3b185031c40772b.tar.gz puppet-stdlib-ce48eb6e7a76f74e1f61c76ac3b185031c40772b.tar.bz2 |
Allow sort for strings.
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r-- | lib/puppet/parser/functions/sort.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/sort.rb b/lib/puppet/parser/functions/sort.rb index 54a4018..49ca20a 100644 --- a/lib/puppet/parser/functions/sort.rb +++ b/lib/puppet/parser/functions/sort.rb @@ -12,7 +12,13 @@ module Puppet::Parser::Functions "given #{arguments.size} for 1") end - arguments[0].sort + value = arguments[0] + + if value.is_a?(Array) then + value.sort + elsif value.is_a?(String) then + value.split("").sort.to_s + end end end |