Skip to content

Commit 3a2be7c

Browse files
committed
Merge pull request #1068 from hunner/eputnam-strings
(PDOC-210) add Puppet Strings documentation
2 parents 4140898 + c781575 commit 3a2be7c

37 files changed

+1602
-947
lines changed

README.md

Lines changed: 1 addition & 903 deletions
Large diffs are not rendered by default.

REFERENCE.md

Lines changed: 1180 additions & 0 deletions
Large diffs are not rendered by default.

lib/puppet/parser/functions/mysql_deepmerge.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
# Recursively merges two or more hashes together and returns the resulting hash.
2-
module Puppet::Parser::Functions
1+
module Puppet::Parser::Functions # rubocop:disable Style/Documentation
32
newfunction(:mysql_deepmerge, type: :rvalue, doc: <<-'ENDHEREDOC') do |args|
4-
Recursively merges two or more hashes together and returns the resulting hash.
5-
6-
For example:
3+
@summary Recursively merges two or more hashes together and returns the resulting hash.
74
5+
@example
86
$hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
97
$hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
108
$merged_hash = mysql_deepmerge($hash1, $hash2)
119
# The resulting hash is equivalent to:
1210
# $merged_hash = { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } }
1311
14-
When there is a duplicate key that is a hash, they are recursively merged.
15-
When there is a duplicate key that is not a hash, the key in the rightmost hash will "win."
16-
When there are conficting uses of dashes and underscores in two keys (which mysql would otherwise equate),
12+
- When there is a duplicate key that is a hash, they are recursively merged.
13+
- When there is a duplicate key that is not a hash, the key in the rightmost hash will "win."
14+
- When there are conficting uses of dashes and underscores in two keys (which mysql would otherwise equate),
1715
the rightmost style will win.
1816
17+
@return [Hash]
1918
ENDHEREDOC
2019

2120
if args.length < 2

lib/puppet/parser/functions/mysql_dirname.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
# Returns the dirname of a path.
2-
module Puppet::Parser::Functions
1+
module Puppet::Parser::Functions # rubocop:disable Style/Documentation
32
newfunction(:mysql_dirname, type: :rvalue, doc: <<-EOS
4-
Returns the dirname of a path.
3+
@summary
4+
Returns the dirname of a path
5+
6+
@param [String] path
7+
Path to find the dirname for.
8+
9+
@return [String]
10+
Directory name of path.
511
EOS
612
) do |arguments|
713

lib/puppet/parser/functions/mysql_password.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
require 'digest/sha1'
2-
# Returns the mysql password hash from the clear text password.
3-
# Hash a string as mysql's "PASSWORD()" function would do it
4-
module Puppet::Parser::Functions
2+
module Puppet::Parser::Functions # rubocop:disable Style/Documentation
53
newfunction(:mysql_password, type: :rvalue, doc: <<-EOS
6-
Returns the mysql password hash from the clear text password.
4+
@summary
5+
Hash a string as mysql's "PASSWORD()" function would do it
6+
7+
@param [String] password Plain text password.
8+
9+
@return [String] the mysql password hash from the clear text password.
710
EOS
811
) do |args|
912

lib/puppet/type/mysql_database.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Puppet::Type.newtype(:mysql_database) do
2-
@doc = 'Manage MySQL databases.'
2+
@doc = <<-PUPPET
3+
@summary
4+
Manage a MySQL database.
5+
6+
@api private
7+
PUPPET
38

49
ensurable
510

lib/puppet/type/mysql_datadir.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Puppet::Type.newtype(:mysql_datadir) do
2-
@doc = 'Manage MySQL datadirs with mysql_install_db OR mysqld (5.7.6 and above).'
2+
@doc = <<-PUPPET
3+
@summary
4+
Manage MySQL datadirs with mysql_install_db OR mysqld (5.7.6 and above).
5+
6+
@api private
7+
PUPPET
38

49
ensurable
510

lib/puppet/type/mysql_grant.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# This has to be a separate type to enable collecting
21
Puppet::Type.newtype(:mysql_grant) do
3-
@doc = "Manage a MySQL user's rights."
2+
@doc = <<-PUPPET
3+
@summary
4+
Manage a MySQL user's rights.
5+
6+
@api private
7+
PUPPET
48
ensurable
59

610
autorequire(:file) { '/root/.my.cnf' }

lib/puppet/type/mysql_plugin.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
Puppet::Type.newtype(:mysql_plugin) do
2-
@doc = 'Manage MySQL plugins.'
2+
@doc = <<-PUPPET
3+
@summary
4+
Manage MySQL plugins.
5+
6+
@example
7+
mysql_plugin { 'some_plugin':
8+
soname => 'some_pluginlib.so',
9+
}
10+
11+
PUPPET
312

413
ensurable
514

lib/puppet/type/mysql_user.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# This has to be a separate type to enable collecting
22
Puppet::Type.newtype(:mysql_user) do
3-
@doc = 'Manage a MySQL user. This includes management of users password as well as privileges.'
3+
@doc = <<-PUPPET
4+
@summary
5+
Manage a MySQL user. This includes management of users password as well as privileges.
6+
7+
@api private
8+
PUPPET
49

510
ensurable
611

0 commit comments

Comments
 (0)