Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frozen string literal issue for ruby 3.4.0 #91

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
ruby-version: ['3.1', '3.0', '2.7']
ruby-version: ['3.3', '3.1', '2.7']

steps:
- uses: actions/checkout@v3
Expand All @@ -26,5 +26,4 @@ jobs:
- name: Install PDFTK-Java
run: sudo apt install -y pdftk-java
- name: Run tests
run: bundle exec rake

run: RUBYOPT='--enable-frozen-string-literal --debug-frozen-string-literal' bundle exec rake
2 changes: 1 addition & 1 deletion lib/pdf_forms/data_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(data = {}, options = {})

# generate PDF content in this data format
def to_pdf_data
pdf_data = header
pdf_data = +header

@data.each do |key, value|
if Hash === value
Expand Down
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
2 changes: 1 addition & 1 deletion lib/pdf_forms/pdftk_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def call_pdftk(*args)
def cat(*args)
in_files = []
page_ranges = []
file_handle = "A"
file_handle = +"A"
output = normalize_path args.pop

args.flatten.compact.each do |in_file|
Expand Down