summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKen Barber <ken@bob.sh>2011-07-29 00:10:31 +0100
committerKen Barber <ken@bob.sh>2011-07-29 00:10:31 +0100
commitce48eb6e7a76f74e1f61c76ac3b185031c40772b (patch)
treedbb7d442fe1678a7bb208b395e0acf58e7357d5a /lib
parent7d6ae5d57ce45ff1293f02b90c816a7f938a3af6 (diff)
downloadpuppet-stdlib-ce48eb6e7a76f74e1f61c76ac3b185031c40772b.tar.gz
puppet-stdlib-ce48eb6e7a76f74e1f61c76ac3b185031c40772b.tar.bz2
Allow sort for strings.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/sort.rb8
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