From 7835d2927ef360216612f1a782e88a6606a79d6b Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 7 May 2007 23:59:44 +0000 Subject: [PATCH] Adding a dynamic? option for references, so those are not stored in trac git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2480 980ebf18-57e1-0310-9a29-db15c13687c0 --- bin/puppetdoc | 5 ++++- lib/puppet/reference/network.rb | 4 ++++ lib/puppet/reference/providers.rb | 3 ++- lib/puppet/util/reference.rb | 7 +++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bin/puppetdoc b/bin/puppetdoc index c5bf63f03..aebc86082 100755 --- a/bin/puppetdoc +++ b/bin/puppetdoc @@ -95,7 +95,10 @@ rescue GetoptLong::InvalidOption => detail end if options[:all] - options[:references] = Puppet::Util::Reference.loaded_instances(:reference) + # Don't add dynamic references to the "all" list. + options[:references] = Reference.references.reject do |ref| + Reference.reference(ref).dynamic? + end end if options[:references].empty? diff --git a/lib/puppet/reference/network.rb b/lib/puppet/reference/network.rb index 32a1fdd89..5eceea58f 100644 --- a/lib/puppet/reference/network.rb +++ b/lib/puppet/reference/network.rb @@ -30,4 +30,8 @@ Most handlers are meant to be started on the server, usually within ``puppetmasterd``, and the clients are mostly started on the client, usually within ``puppetd``. +You can find the server-side handler for each interface at +``puppet/network/handler/.rb`` and the client class at +``puppet/network/client/.rb``. + " diff --git a/lib/puppet/reference/providers.rb b/lib/puppet/reference/providers.rb index 2d9d7f8cb..80282b9bc 100644 --- a/lib/puppet/reference/providers.rb +++ b/lib/puppet/reference/providers.rb @@ -1,4 +1,5 @@ -providers = Puppet::Util::Reference.newreference :providers, :doc => "Which providers are valid for this machine" do +# This doesn't get stored in trac, since it changes every time. +providers = Puppet::Util::Reference.newreference :providers, :dynamic => true, :doc => "Which providers are valid for this machine" do types = [] Puppet::Type.loadall Puppet::Type.eachtype do |klass| diff --git a/lib/puppet/util/reference.rb b/lib/puppet/util/reference.rb index 980baef4d..85d823e9b 100644 --- a/lib/puppet/util/reference.rb +++ b/lib/puppet/util/reference.rb @@ -74,7 +74,7 @@ class Puppet::Util::Reference HEADER_LEVELS = [nil, "=", "-", "+", "'", "~"] - attr_accessor :page, :depth, :header, :title + attr_accessor :page, :depth, :header, :title, :dynamic attr_writer :doc def doc @@ -85,6 +85,10 @@ class Puppet::Util::Reference end end + def dynamic? + self.dynamic + end + def h(name, level) return "%s\n%s\n\n" % [name, HEADER_LEVELS[level] * name.to_s.length] end @@ -171,7 +175,6 @@ class Puppet::Util::Reference $stderr.puts output end end - end # $Id$