diff options
author | nfagerlund <nick.fagerlund@gmail.com> | 2011-02-09 10:41:32 -0800 |
---|---|---|
committer | nfagerlund <nick.fagerlund@gmail.com> | 2011-02-09 10:41:32 -0800 |
commit | 0b7faa6c95dbb734019a6e659b838ef24103571a (patch) | |
tree | bc0242301e44af3b31ea5f97e4ad9dcbbec53c12 /lib/puppet/parser/functions/split.rb | |
parent | 637e139556d7a0fa37d9e7626cfedb23430177d6 (diff) | |
download | puppet-0b7faa6c95dbb734019a6e659b838ef24103571a.tar.gz puppet-0b7faa6c95dbb734019a6e659b838ef24103571a.tar.xz puppet-0b7faa6c95dbb734019a6e659b838ef24103571a.zip |
(#6270) Fix formatting in split function's doc string
* Repaired a 2-indent/4-indent issue that kept a code block from being recognized
* Wrapped literal strings in backticks to format as code and protect from Markdown
* Added note about backslashes for escaping metacharacters.
Diffstat (limited to 'lib/puppet/parser/functions/split.rb')
-rw-r--r-- | lib/puppet/parser/functions/split.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb index 52394095a..ad027865b 100644 --- a/lib/puppet/parser/functions/split.rb +++ b/lib/puppet/parser/functions/split.rb @@ -6,21 +6,21 @@ module Puppet::Parser::Functions :doc => "\ Split a string variable into an array using the specified split regexp. - Usage: +*Example:* $string = 'v1.v2:v3.v4' $array_var1 = split($string, ':') $array_var2 = split($string, '[.]') $array_var3 = split($string, '[.:]') -$array_var1 now holds the result ['v1.v2', 'v3.v4'], -while $array_var2 holds ['v1', 'v2:v3', 'v4'], and -$array_var3 holds ['v1', 'v2', 'v3', 'v4']. +`$array_var1` now holds the result `['v1.v2', 'v3.v4']`, +while `$array_var2` holds `['v1', 'v2:v3', 'v4']`, and +`$array_var3` holds `['v1', 'v2', 'v3', 'v4']`. -Note that in the second example, we split on a string that contains -a regexp meta-character (.), and that needs protection. A simple +Note that in the second example, we split on a literal string that contains +a regexp meta-character (.), which must be escaped. A simple way to do that for a single character is to enclose it in square -brackets.") do |args| +brackets; a backslash will also escape a single character.") do |args| raise Puppet::ParseError, ("split(): wrong number of arguments (#{args.length}; must be 2)") if args.length != 2 |