diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 08:30:27 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 08:30:27 +0000 |
commit | 547fb64aec7def14987abfb3a01970a2b4471847 (patch) | |
tree | 70fa8642dbbfc1fe80393643d923e2f640653042 /lib | |
parent | 5b2ffbcb5d2e4113efec9c8ba882c5506d53c242 (diff) | |
download | puppet-547fb64aec7def14987abfb3a01970a2b4471847.tar.gz puppet-547fb64aec7def14987abfb3a01970a2b4471847.tar.xz puppet-547fb64aec7def14987abfb3a01970a2b4471847.zip |
Adding a provider feature table to the provider feature docs
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2314 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/util/provider_features.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/puppet/util/provider_features.rb b/lib/puppet/util/provider_features.rb index c378ff805..fc59cc0b3 100644 --- a/lib/puppet/util/provider_features.rb +++ b/lib/puppet/util/provider_features.rb @@ -39,10 +39,31 @@ module Puppet::Util::ProviderFeatures str = "" @features ||= {} return nil if @features.empty? - @features.each do |name, feature| - doc = feature.docs.gsub(/\n\s+/, " ") + names = @features.keys.sort { |a,b| a.to_s <=> b.to_s } + names.each do |name| + doc = @features[name].docs.gsub(/\n\s+/, " ") str += " - **%s**: %s\n" % [name, doc] end + if providers.length > 0 + str += "<table><tr><th></th>\n" + names.each do |name| + str += "<th>%s</th>" % name + end + str += "</tr>\n" + providers.each do |provname| + prov = provider(provname) + str += "<tr><td>%s</td>" % provname + names.each do |feature| + have = "" + if prov.feature?(feature) + have = "<strong>X</strong>" + end + str += "<td>%s</td>" % have + end + str += "</tr>\n" + end + str += "</table>\n" + end str end |