Skip to content

Commit

Permalink
Fix frozen string literal issue
Browse files Browse the repository at this point in the history
To prepare for ruby 3.4.0 and making strings frozen by default, we add `+` operator to make the string mutable
  • Loading branch information
chaadow authored Jul 3, 2024
1 parent 5094ae6 commit f0aaea6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pdf_forms/fdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def encode_data(fdf)

# pp 559 https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/PDFReference.pdf
def header
header = "%FDF-1.2\n\n1 0 obj\n<<\n/FDF << /Fields 2 0 R"
header = +"%FDF-1.2\n\n1 0 obj\n<<\n/FDF << /Fields 2 0 R"

# /F
header << "/F (#{options[:file]})" if options[:file]
Expand All @@ -45,7 +45,7 @@ def header

# pp 561 https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/PDFReference.pdf
def field(key, value)
field = "<<"
field = +"<<"
field << "/T" + "(#{key})"
field << "/V" + (Array === value ? "[#{value.map{ |v|"(#{quote(v)})" }.join}]" : "(#{quote(value)})")
field << ">>\n"
Expand Down

0 comments on commit f0aaea6

Please sign in to comment.