Skip to content

Commit cae22b4

Browse files
DavidSCiaran McCrisken
authored andcommitted
Fix frozen string errors
1 parent 03d4b82 commit cae22b4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/puppet/parser/functions/fqdn_rand_string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
rand_string = ''
4040
for current in 1..length # rubocop:disable Style/For : An each loop would not work correctly in this circumstance
41-
rand_string << charset[function_fqdn_rand([charset.size, (args + [current.to_s]).join(':')]).to_i]
41+
rand_string += charset[function_fqdn_rand([charset.size, (args + [current.to_s]).join(':')]).to_i]
4242
end
4343

4444
rand_string

spec/functions/validate_x509_rsa_key_pair_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def truncate_middle(string)
176176
start_pos = middle - (chars_to_truncate / 2)
177177
end_pos = middle + (chars_to_truncate / 2)
178178

179-
string[start_pos...end_pos] = ''
180-
string
179+
string[0..start_pos] + string[end_pos..-1]
181180
end
182181
end

0 commit comments

Comments
 (0)