Skip to content

Commit 6da5a2f

Browse files
committed
Revert "(CONT-801) Deprecate uriescape.rb"
This reverts commit 799d608. While uriescape was deprecated for Puppet 8 in puppetlabs#1307 it was already fixed earlier for Puppet 8 and ruby 3 in puppetlabs#1195 It is unclear to me why this function was deprecated. * Fixes puppetlabs#1401
1 parent 4846f84 commit 6da5a2f

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

lib/puppet/parser/functions/uriescape.rb

-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@ module Puppet::Parser::Functions
1515
@return [String]
1616
a string that contains the converted value
1717
18-
> **Note:** **Deprecated:** Starting Puppet 8, our Ruby version has upgraded to 3.2.
19-
Therefore, its no longer possible to call URI.escape as it was deprecated by 2.7 and removed completely by 3+.
20-
This function should be removed once Puppet 7 is no longer supported.
2118
DOC
2219
) do |arguments|
23-
raise(Puppet::ParseError, 'Puppet: This function is not available in Puppet 8. URI.escape no longer exists as of Ruby 3+.') if Puppet::Util::Package.versioncmp(Puppet.version, '8').positive?
24-
2520
raise(Puppet::ParseError, "uriescape(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
2621

2722
value = arguments[0]

spec/functions/uriescape_spec.rb

-4
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,5 @@
3939
it { is_expected.to run.with_params(['one}', 'two']).and_return(['one%7D', 'two']) }
4040
it { is_expected.to run.with_params(['one}', 1, true, {}, 'two']).and_return(['one%7D', 1, true, {}, 'two']) }
4141
end
42-
else
43-
describe 'raising errors in Puppet 8' do
44-
it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, %r{This function is not available in Puppet 8. URI.escape no longer exists as of Ruby 3+.}) }
45-
end
4642
end
4743
end

0 commit comments

Comments
 (0)