summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-27 16:30:53 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-27 16:30:53 +0000
commit789b786d24ab83e963b802b81c6f8254c4b4e08c (patch)
treecc57b97ab958e6d7ad3be1f5fd94898b2f66cc3b /lib/puppet/parser/functions.rb
parent4c885b7aa48746b6b946c7b2b0cd0abc50216ecf (diff)
downloadpuppet-789b786d24ab83e963b802b81c6f8254c4b4e08c.tar.gz
puppet-789b786d24ab83e963b802b81c6f8254c4b4e08c.tar.xz
puppet-789b786d24ab83e963b802b81c6f8254c4b4e08c.zip
More code related to #517. Oops.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2227 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/functions.rb')
-rw-r--r--lib/puppet/parser/functions.rb16
1 files changed, 12 insertions, 4 deletions
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