summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/parser/functions/split.rb2
-rw-r--r--lib/puppet/type/augeas.rb1
-rwxr-xr-xlib/puppet/type/tidy.rb13
-rw-r--r--lib/puppet/util/docs.rb12
4 files changed, 19 insertions, 9 deletions
diff --git a/lib/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb
index c555d676e..cfb3ab59e 100644
--- a/lib/puppet/parser/functions/split.rb
+++ b/lib/puppet/parser/functions/split.rb
@@ -1,7 +1,9 @@
module Puppet::Parser::Functions
newfunction(:split, :type => :rvalue,
:doc => "Split a string variable into an array using the specified split character.
+
Usage::
+
$string = 'value1,value2'
$array_var = split($string, ',')
diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb
index da9cff369..5509e1a8f 100644
--- a/lib/puppet/type/augeas.rb
+++ b/lib/puppet/type/augeas.rb
@@ -96,6 +96,7 @@ Puppet::Type.newtype(:augeas) do
Inserts an empty node LABEL either [WHERE={before|after}] PATH.
insert [LABEL] [WHERE] [PATH]
Synonym for ins
+
If the parameter 'context' is set that value is prepended to PATH"
munge do |value|
diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb
index eebf333cd..5eb23f2b8 100755
--- a/lib/puppet/type/tidy.rb
+++ b/lib/puppet/type/tidy.rb
@@ -24,16 +24,17 @@ Puppet::Type.newtype(:tidy) do
the list of files to be tidied to those whose basenames match
at least one of the patterns specified. Multiple patterns can
be specified using an array.
-
+
+ Example::
+
tidy { \"/tmp\":
- age => \"1w\",
- recurse => false,
+ age => \"1w\",
+ recurse => false,
matches => [ \"[0-9]pub*.tmp\", \"*.temp\", \"tmpfile?\" ]
}
- The example above removes files from \/tmp if they are one week
- old or older, are not in a subdirectory and match one of the shell
- globs given.
+ This removes files from \/tmp if they are one week old or older,
+ are not in a subdirectory and match one of the shell globs given.
Note that the patterns are matched against the
basename of each file -- that is, your glob patterns should not
diff --git a/lib/puppet/util/docs.rb b/lib/puppet/util/docs.rb
index 54d1052f3..860a5453c 100644
--- a/lib/puppet/util/docs.rb
+++ b/lib/puppet/util/docs.rb
@@ -90,9 +90,15 @@ module Puppet::Util::Docs
indent = nil
# If we can match an indentation, then just remove that same level of
- # indent from every line.
- if text =~ /^(\s+)/
- indent = $1
+ # indent from every line. However, ignore any indentation on the
+ # first line, since that can be inconsistent.
+ text = text.lstrip()
+ text.gsub!(/^([\t]+)/) { |s| " "*8*s.length(); } # Expand leading tabs
+ # Find first non-empty line after the first line:
+ line2start = (text =~ /(\n?\s*\n)/)
+ line2start += $1.length
+ if (text[line2start..-1] =~ /^([ ]+)\S/) == 0
+ indent = Regexp.quote($1)
begin
return text.gsub(/^#{indent}/,'')
rescue => detail