|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -# @summary |
4 | | -# Validate that all values passed are valid email addresses. |
5 | | -# Fail compilation if any value fails this check. |
6 | | -Puppet::Functions.create_function(:validate_email_address) do |
7 | | - # @param values An e-mail address or an array of e-mail addresses to check |
8 | | - # |
9 | | - # @return [Undef] |
10 | | - # Fail compilation if any value fails this check. |
11 | | - # |
12 | | - # @example Passing examples |
13 | | - # $my_email = "waldo@gmail.com" |
14 | | - # validate_email_address($my_email) |
15 | | - # validate_email_address("bob@gmail.com", "alice@gmail.com", $my_email) |
16 | | - # |
17 | | - # @example Failing examples (causing compilation to abort) |
18 | | - # $some_array = [ 'bad_email@/d/efdf.com' ] |
19 | | - # validate_email_address($some_array) |
20 | | - dispatch :validate_email_address do |
21 | | - repeated_param 'Stdlib::Email', :values |
22 | | - end |
| 3 | +# THIS FILE WAS GENERATED BY `rake regenerate_unamespaced_shims` |
23 | 4 |
|
24 | | - def validate_email_address(*args) |
25 | | - assert_arg_count(args) |
| 5 | +# @summary DEPRECATED. Use the namespaced function [`stdlib::validate_email_address`](#stdlibvalidate_email_address) instead. |
| 6 | +Puppet::Functions.create_function(:validate_email_address) do |
| 7 | + dispatch :deprecation_gen do |
| 8 | + repeated_param 'Any', :args |
26 | 9 | end |
27 | | - |
28 | | - def assert_arg_count(args) |
29 | | - raise(ArgumentError, 'validate_email_address(): Wrong number of arguments need at least one') if args.empty? |
| 10 | + def deprecation_gen(*args) |
| 11 | + call_function('deprecation', 'validate_email_address', 'This function is deprecated, please use stdlib::validate_email_address instead.') |
| 12 | + call_function('stdlib::validate_email_address', *args) |
30 | 13 | end |
31 | 14 | end |
0 commit comments