puppetlabs-stdlib/lib/puppet/parser/functions/sort.rb

21 lines
344 B
Ruby
Raw Normal View History

#
# sort.rb
#
module Puppet::Parser::Functions
newfunction(:sort, :type => :rvalue, :doc => <<-EOS
EOS
) do |arguments|
2011-07-24 01:39:17 +02:00
if (arguments.size != 1) then
raise(Puppet::ParseError, "sort(): Wrong number of arguments "+
2011-07-24 01:39:17 +02:00
"given #{arguments.size} for 1")
end
2011-07-24 01:39:17 +02:00
arguments[0].sort
end
end
# vim: set ts=2 sw=2 et :