Skip to content

Commit 08d9680

Browse files
authored
Merge pull request #741 from HelenCampbell/utf8readme
(FM-6051) Adds comments to warn for UTF8 incompatibility
2 parents a38c9b7 + 2c138de commit 08d9680

File tree

13 files changed

+49
-7
lines changed

13 files changed

+49
-7
lines changed

README.markdown

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ Converts a string to and from base64 encoding. Requires an `action` ('encode', '
209209

210210
For backward compatibility, `method` will be set as `default` if not specified.
211211

212+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
213+
212214
*Examples:*
213215
~~~
214216
base64('encode', 'hello')
@@ -263,10 +265,18 @@ bool2str(false, 't', 'f') => 'f'
263265

264266
Requires a single boolean as input. *Type*: rvalue.
265267

268+
#### `camelcase`
269+
270+
Converts the case of a string or all strings in an array to camel case. *Type*: rvalue.
271+
272+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
273+
266274
#### `capitalize`
267275

268276
Capitalizes the first character of a string or array of strings and lowercases the remaining characters of each string. Requires either a single string or an array as an input. *Type*: rvalue.
269277

278+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
279+
270280
#### `ceiling`
271281

272282
Returns the smallest integer greater than or equal to the argument. Takes a single numeric value as an argument. *Type*: rvalue.
@@ -349,6 +359,8 @@ Deletes a determined indexed value from an array. For example, `delete_at(['a','
349359

350360
Deletes all instances of a given element from an array or hash that match a provided regular expression. A string will be treated as a one-item array.
351361

362+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
363+
352364
For example, `delete_regex(['a','b','c','b'], 'b')` returns ['a','c']; `delete_regex({'a' => 1,'b' => 2,'c' => 3},['b','c'])` returns {'a'=> 1}, `delete_regex(['abf', 'ab', 'ac'], '^ab.*')` returns ['ac']. `delete_regex(['ab', 'b'], 'b')` returns ['ab'].
353365

354366
*Type*: rvalue.
@@ -477,6 +489,8 @@ See also [unix2dos](#unix2dos).
477489

478490
Converts the case of a string or of all strings in an array to lowercase. *Type*: rvalue.
479491

492+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
493+
480494
#### `empty`
481495

482496
Returns true if the argument is an array or hash that contains no elements, or an empty string. Returns false when the argument is a numerical value. *Type*: rvalue.
@@ -1014,6 +1028,8 @@ The third argument to this function is the salt to use.
10141028

10151029
*Type*: rvalue.
10161030

1031+
**Please note:** This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1032+
10171033
**Note:** this uses the Puppet master's implementation of crypt(3). If your environment contains several different operating systems, ensure that they are compatible before using this function.
10181034

10191035
#### `range`
@@ -1093,6 +1109,8 @@ Returns the number of elements in a string, an array or a hash. May get confused
10931109

10941110
Sorts strings and arrays lexically. *Type*: rvalue.
10951111

1112+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1113+
10961114
#### `squeeze`
10971115

10981116
Returns a new string where runs of the same character that occur in this set are replaced by a single character. *Type*: rvalue.
@@ -1106,10 +1124,14 @@ Converts certain strings to a boolean. This attempts to convert strings that con
11061124
Converts a string to a salted-SHA512 password hash, used for OS X versions >= 10.7. Given any string, this function returns a hex version of a salted-SHA512 password hash, which can be inserted into your Puppet
11071125
manifests as a valid password attribute. *Type*: rvalue.
11081126

1127+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1128+
11091129
#### `strftime`
11101130

11111131
Returns formatted time. For example, `strftime("%s")` returns the time since Unix epoch, and `strftime("%Y-%m-%d")` returns the date. *Type*: rvalue.
11121132

1133+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1134+
11131135
*Format:*
11141136

11151137
* `%a`: The abbreviated weekday name ('Sun')
@@ -1175,6 +1197,8 @@ For example:
11751197

11761198
Swaps the existing case of a string. For example, `swapcase("aBcD")` results in "AbCd". *Type*: rvalue.
11771199

1200+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1201+
11781202
#### `time`
11791203

11801204
Returns the current Unix epoch time as an integer. For example, `time()` returns something like '1311972653'. *Type*: rvalue.
@@ -1262,10 +1286,14 @@ See also [dos2unix](#dos2unix).
12621286

12631287
Converts an object, array or hash of objects that respond to upcase to uppercase. For example, `upcase('abcd')` returns 'ABCD'. *Type*: rvalue.
12641288

1289+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1290+
12651291
#### `uriescape`
12661292

12671293
URLEncodes a string or array of strings. Requires either a single string or an array as an input. *Type*: rvalue.
12681294

1295+
*Please note:* This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
1296+
12691297
#### `validate_absolute_path`
12701298

12711299
Validates that a given string represents an absolute path in the filesystem. Works for Windows and Unix style paths.

lib/puppet/parser/functions/base64.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
3+
14
module Puppet::Parser::Functions
25

36
newfunction(:base64, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|

lib/puppet/parser/functions/camelcase.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
22
# camelcase.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions

lib/puppet/parser/functions/capitalize.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
22
# capitalize.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions
@@ -27,5 +28,3 @@ module Puppet::Parser::Functions
2728
return result
2829
end
2930
end
30-
31-
# vim: set ts=2 sw=2 et :

lib/puppet/parser/functions/delete_regex.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# delete_regex.rb
2+
# delete_regex.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions

lib/puppet/parser/functions/downcase.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
22
# downcase.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions

lib/puppet/parser/functions/pw_hash.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
3+
14
Puppet::Parser::Functions::newfunction(
25
:pw_hash,
36
:type => :rvalue,

lib/puppet/parser/functions/sort.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# sort.rb
2+
# sort.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions

lib/puppet/parser/functions/str2saltedsha512.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# str2saltedsha512.rb
2+
# str2saltedsha512.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions

lib/puppet/parser/functions/strftime.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# strftime.rb
2+
# strftime.rb
3+
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
34
#
45

56
module Puppet::Parser::Functions

0 commit comments

Comments
 (0)