Skip to content

Commit

Permalink
Ruby 3 KwArg: Form526 Convert to PDF (#11915)
Browse files Browse the repository at this point in the history
Ruby 2.7 deprecated automatic casting of a hash passed as the last
argument of a method to keyword arguments. You must now use actual
keyword arguments (`foo(bar: 'baz')` instead of ` foo({bar: 'baz'})`) or cast the hash to a keyword args using the double splat (`foo(**{bar: 'baz'})`).

In preparation for upgrading to Ruby 3.0, we're implementing the new syntax.
  • Loading branch information
ericboehs authored Feb 28, 2023
1 parent 8a3c58d commit daf86f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/form526_backup_submission/utilities/convert_to_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def convert_txt!
# We COULD download more fonts if we needed more char/unicode support.
# But for now sending through with non-'Windows-1252' encoded chars stripped should work.
# Can expand later if needed.
content = File.read(@original_file).encode('Windows-1252', { invalid: :replace, undef: :replace, replace: '' })
content = File.read(@original_file).encode('Windows-1252', invalid: :replace, undef: :replace, replace: '')
Prawn::Document.generate(@converted_filename) do |pdf|
pdf.text generate_pdf_title_page
pdf.start_new_page
Expand Down

0 comments on commit daf86f6

Please sign in to comment.