summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-09 21:06:47 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-09 21:06:47 +0000
commitb14982a1354f477ee30ab44d340ea1e47e902257 (patch)
treed54c9433b581b20dc7c641f0140b622692ccd9e7 /lib/puppet/util
parentaa2da583d03b0f72ec27304c7de079767075f7e6 (diff)
downloadpuppet-b14982a1354f477ee30ab44d340ea1e47e902257.tar.gz
puppet-b14982a1354f477ee30ab44d340ea1e47e902257.tar.xz
puppet-b14982a1354f477ee30ab44d340ea1e47e902257.zip
Small fixes here and there. The rails changes needs to be pushed through the collection code, so I am committing so Blake can take a look at that.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1844 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/util')
-rw-r--r--lib/puppet/util/docs.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/puppet/util/docs.rb b/lib/puppet/util/docs.rb
index 01aea7d3d..ebbce7317 100644
--- a/lib/puppet/util/docs.rb
+++ b/lib/puppet/util/docs.rb
@@ -26,6 +26,34 @@ module Puppet::Util::Docs
extra
end
end
+
+ # Handle the inline indentation in the docs.
+ def scrub(text)
+ # Stupid markdown
+ #text = text.gsub("<%=", "&lt;%=")
+ # For text with no carriage returns, there's nothing to do.
+ if text !~ /\n/
+ return text
+ end
+ indent = nil
+
+ # If we can match an indentation, then just remove that same level of
+ # indent from every line.
+ if text =~ /^(\s+)/
+ indent = $1
+ begin
+ return text.gsub(/^#{indent}/,'')
+ rescue => detail
+ puts detail.backtrace
+ puts detail
+ end
+ else
+ return text
+ end
+
+ end
+
+ module_function :scrub
end
# $Id$