From 789b786d24ab83e963b802b81c6f8254c4b4e08c Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 27 Feb 2007 16:30:53 +0000 Subject: More code related to #517. Oops. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2227 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/parser/functions.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/puppet/parser/functions.rb') diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb index 47c5ff110..288a3bd68 100644 --- a/lib/puppet/parser/functions.rb +++ b/lib/puppet/parser/functions.rb @@ -213,16 +213,24 @@ module Functions # This is just syntactic sugar for a collection, although it will generally # be a good bit faster. newfunction(:realize, :doc => "Make a virtual object real. This is useful - when you want to know the name of the virtual object and don't want to - bother with a full collection. It is slightly faster than a collection, - and, of course, is a bit shorter. You must pass the object using a - reference; e.g.: ``realize User[luke]``." ) do |vals| + when you want to know the name of the virtual object and don't want to + bother with a full collection. It is slightly faster than a collection, + and, of course, is a bit shorter. You must pass the object using a + reference; e.g.: ``realize User[luke]``." ) do |vals| coll = Puppet::Parser::Collector.new(self, :nomatter, nil, nil, :virtual) vals = [vals] unless vals.is_a?(Array) coll.resources = vals newcollection(coll) end + + newfunction(:search, :doc => "Add another namespace for this class to search. + This allows you to create classes with sets of definitions and add + those classes to another class's search path.") do |vals| + vals.each do |val| + add_namespace(val) + end + end end end -- cgit