diff --git a/example/rails/app/controllers/example001_controller.rb b/example/rails/app/controllers/example001_controller.rb
index 4147ce29..7b4e5e6d 100644
--- a/example/rails/app/controllers/example001_controller.rb
+++ b/example/rails/app/controllers/example001_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example002_controller.rb b/example/rails/app/controllers/example002_controller.rb
index 2c16973c..25a37ad4 100644
--- a/example/rails/app/controllers/example002_controller.rb
+++ b/example/rails/app/controllers/example002_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example003_controller.rb b/example/rails/app/controllers/example003_controller.rb
index 99c06a94..7d3704e3 100644
--- a/example/rails/app/controllers/example003_controller.rb
+++ b/example/rails/app/controllers/example003_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example004_controller.rb b/example/rails/app/controllers/example004_controller.rb
index a0e9b429..38d77eba 100644
--- a/example/rails/app/controllers/example004_controller.rb
+++ b/example/rails/app/controllers/example004_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example005_controller.rb b/example/rails/app/controllers/example005_controller.rb
index ba114cd8..414f52b8 100644
--- a/example/rails/app/controllers/example005_controller.rb
+++ b/example/rails/app/controllers/example005_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example006_controller.rb b/example/rails/app/controllers/example006_controller.rb
index 8ece7e54..a22c19e1 100644
--- a/example/rails/app/controllers/example006_controller.rb
+++ b/example/rails/app/controllers/example006_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
@@ -219,8 +220,8 @@ def index
# add a page
pdf.add_page()
- textcolors = '
HTML Text Colors
'
- bgcolors = '
HTML Background Colors
'
+ textcolors = +'HTML Text Colors
'
+ bgcolors = +'
HTML Background Colors
'
@@webcolor.each{|k,v|
textcolors << '' + v + ' '
diff --git a/example/rails/app/controllers/example007_controller.rb b/example/rails/app/controllers/example007_controller.rb
index 6c075de5..25e06ebf 100644
--- a/example/rails/app/controllers/example007_controller.rb
+++ b/example/rails/app/controllers/example007_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example008_controller.rb b/example/rails/app/controllers/example008_controller.rb
index f620a9fe..f358176d 100644
--- a/example/rails/app/controllers/example008_controller.rb
+++ b/example/rails/app/controllers/example008_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
@@ -57,10 +58,10 @@ def index
pdf.add_page()
# get esternal file content
- utf8text=''
+ utf8text = +''
file = PDF_UTF8TEST_TXT
open(file,'rb') do |f|
- utf8text<HTML Fill text
'
html << 'HTML Stroke text
'
html << 'HTML Fill, then stroke text
'
html << 'HTML Neither fill nor stroke text (invisible)
'
diff --git a/example/rails/app/controllers/example028_controller.rb b/example/rails/app/controllers/example028_controller.rb
index 288e41fb..21deb6d6 100644
--- a/example/rails/app/controllers/example028_controller.rb
+++ b/example/rails/app/controllers/example028_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example029_controller.rb b/example/rails/app/controllers/example029_controller.rb
index ce94b3e8..fa96c6a7 100644
--- a/example/rails/app/controllers/example029_controller.rb
+++ b/example/rails/app/controllers/example029_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-06-09
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example030_controller.rb b/example/rails/app/controllers/example030_controller.rb
index 918f2bc2..247e427a 100644
--- a/example/rails/app/controllers/example030_controller.rb
+++ b/example/rails/app/controllers/example030_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-06-09
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example031_controller.rb b/example/rails/app/controllers/example031_controller.rb
index e00c781f..8e3c79e3 100644
--- a/example/rails/app/controllers/example031_controller.rb
+++ b/example/rails/app/controllers/example031_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-06-09
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example033_controller.rb b/example/rails/app/controllers/example033_controller.rb
index 8240a33e..e73c585d 100644
--- a/example/rails/app/controllers/example033_controller.rb
+++ b/example/rails/app/controllers/example033_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-06-24
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example034_controller.rb b/example/rails/app/controllers/example034_controller.rb
index 6b187d30..0c5ce274 100644
--- a/example/rails/app/controllers/example034_controller.rb
+++ b/example/rails/app/controllers/example034_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-07-18
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example035_controller.rb b/example/rails/app/controllers/example035_controller.rb
index 4ca1b151..618c2f0e 100644
--- a/example/rails/app/controllers/example035_controller.rb
+++ b/example/rails/app/controllers/example035_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-07-22
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example036_controller.rb b/example/rails/app/controllers/example036_controller.rb
index e4234b1f..b1f7356f 100644
--- a/example/rails/app/controllers/example036_controller.rb
+++ b/example/rails/app/controllers/example036_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-08-08
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example038_controller.rb b/example/rails/app/controllers/example038_controller.rb
index 0ed4e46c..97fd7a06 100644
--- a/example/rails/app/controllers/example038_controller.rb
+++ b/example/rails/app/controllers/example038_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-09-15
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example039_controller.rb b/example/rails/app/controllers/example039_controller.rb
index e574226c..d34efa0e 100644
--- a/example/rails/app/controllers/example039_controller.rb
+++ b/example/rails/app/controllers/example039_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-10-16
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example040_controller.rb b/example/rails/app/controllers/example040_controller.rb
index b20ae537..1f0b5986 100644
--- a/example/rails/app/controllers/example040_controller.rb
+++ b/example/rails/app/controllers/example040_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-10-28
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example041_controller.rb b/example/rails/app/controllers/example041_controller.rb
index caecbf8e..f246691e 100644
--- a/example/rails/app/controllers/example041_controller.rb
+++ b/example/rails/app/controllers/example041_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-12-07
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example042_controller.rb b/example/rails/app/controllers/example042_controller.rb
index fd268835..1223bb68 100644
--- a/example/rails/app/controllers/example042_controller.rb
+++ b/example/rails/app/controllers/example042_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-12-23
# Last Update : 2023-02-23
diff --git a/example/rails/app/controllers/example043_controller.rb b/example/rails/app/controllers/example043_controller.rb
index 4b5b38c1..db2fa211 100644
--- a/example/rails/app/controllers/example043_controller.rb
+++ b/example/rails/app/controllers/example043_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-01-02
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example044_controller.rb b/example/rails/app/controllers/example044_controller.rb
index caac594f..713b5e0c 100644
--- a/example/rails/app/controllers/example044_controller.rb
+++ b/example/rails/app/controllers/example044_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-01-02
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example045_controller.rb b/example/rails/app/controllers/example045_controller.rb
index 0caf270b..6114f480 100644
--- a/example/rails/app/controllers/example045_controller.rb
+++ b/example/rails/app/controllers/example045_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2008-03-04
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example047_controller.rb b/example/rails/app/controllers/example047_controller.rb
index 458e38f8..790972ca 100644
--- a/example/rails/app/controllers/example047_controller.rb
+++ b/example/rails/app/controllers/example047_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-03-19
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example048_controller.rb b/example/rails/app/controllers/example048_controller.rb
index e180255f..83f3c528 100644
--- a/example/rails/app/controllers/example048_controller.rb
+++ b/example/rails/app/controllers/example048_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-03-20
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example051_controller.rb b/example/rails/app/controllers/example051_controller.rb
index fde9b135..3b9b9b23 100644
--- a/example/rails/app/controllers/example051_controller.rb
+++ b/example/rails/app/controllers/example051_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-04-16
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example054_controller.rb b/example/rails/app/controllers/example054_controller.rb
index 62cc3055..2f48750a 100644
--- a/example/rails/app/controllers/example054_controller.rb
+++ b/example/rails/app/controllers/example054_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-09-07
# Last Update : 2010-06-02
diff --git a/example/rails/app/controllers/example055_controller.rb b/example/rails/app/controllers/example055_controller.rb
index 4c1caec4..25589da5 100644
--- a/example/rails/app/controllers/example055_controller.rb
+++ b/example/rails/app/controllers/example055_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2009-10-21
# Last Update : 2010-05-20
@@ -59,7 +60,7 @@ def index
# array of core font names
core_fonts = ['courier', 'helvetica', 'times', 'symbol', 'zapfdingbats']
- html = 'Core Fonts Dump
'
+ html = +'Core Fonts Dump
'
# create one HTML table for each core font
core_fonts.each { |font|
@@ -74,7 +75,7 @@ def index
if i != 0
chr = pdf.unichr(i)
else
- chr = ''
+ chr = +''
end
# replace special characters
chr.gsub!('<', '<')
diff --git a/example/rails/app/controllers/example057_controller.rb b/example/rails/app/controllers/example057_controller.rb
index c7d535c7..afdd2dbf 100644
--- a/example/rails/app/controllers/example057_controller.rb
+++ b/example/rails/app/controllers/example057_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2010-04-03
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example059_controller.rb b/example/rails/app/controllers/example059_controller.rb
index 56521ebb..678e413c 100644
--- a/example/rails/app/controllers/example059_controller.rb
+++ b/example/rails/app/controllers/example059_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2010-05-06
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example060_controller.rb b/example/rails/app/controllers/example060_controller.rb
index 655e3eb1..9a90b316 100644
--- a/example/rails/app/controllers/example060_controller.rb
+++ b/example/rails/app/controllers/example060_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2010-05-17
# Last Update : 2010-05-20
diff --git a/example/rails/app/controllers/example061_controller.rb b/example/rails/app/controllers/example061_controller.rb
index a53e9365..34e2a6ab 100644
--- a/example/rails/app/controllers/example061_controller.rb
+++ b/example/rails/app/controllers/example061_controller.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2010-05-24
# Last Update : 2010-05-25
diff --git a/example/rails/app/controllers/example_common.rb b/example/rails/app/controllers/example_common.rb
index ddb130ac..204b4a9e 100644
--- a/example/rails/app/controllers/example_common.rb
+++ b/example/rails/app/controllers/example_common.rb
@@ -1,4 +1,5 @@
# coding: UTF-8
+# frozen_string_literal: true
#============================================================+
# Begin : 2004-06-11
# Last Update : 2010-04-28
diff --git a/lib/barcode/barcode.rb b/lib/barcode/barcode.rb
index bb579811..eb0777ea 100755
--- a/lib/barcode/barcode.rb
+++ b/lib/barcode/barcode.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : barcode.rb
# Begin : 2002-07-31
diff --git a/lib/barcode/c128aobject.rb b/lib/barcode/c128aobject.rb
index c9543759..154e21bf 100755
--- a/lib/barcode/c128aobject.rb
+++ b/lib/barcode/c128aobject.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : c128aobject.rb
# Begin : 2002-07-31
diff --git a/lib/barcode/c128bobject.rb b/lib/barcode/c128bobject.rb
index 49063975..e401a414 100755
--- a/lib/barcode/c128bobject.rb
+++ b/lib/barcode/c128bobject.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : c128bobject.rb
# Begin : 2002-07-31
diff --git a/lib/barcode/c128cobject.rb b/lib/barcode/c128cobject.rb
index 90766f38..c2ccb1d4 100755
--- a/lib/barcode/c128cobject.rb
+++ b/lib/barcode/c128cobject.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : c128cobject.rb
# Begin : 2002-07-31
diff --git a/lib/barcode/c39object.rb b/lib/barcode/c39object.rb
index efed6940..38d87198 100755
--- a/lib/barcode/c39object.rb
+++ b/lib/barcode/c39object.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : c39object.rb
# Begin : 2002-07-31
diff --git a/lib/barcode/i25object.rb b/lib/barcode/i25object.rb
index 7bdb7588..fa258520 100755
--- a/lib/barcode/i25object.rb
+++ b/lib/barcode/i25object.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : i25aobject.rb
# Begin : 2002-07-31
diff --git a/lib/barcode/image.rb b/lib/barcode/image.rb
index a95b84aa..fba81dea 100755
--- a/lib/barcode/image.rb
+++ b/lib/barcode/image.rb
@@ -1,4 +1,4 @@
-
+# frozen_string_literal: true
#============================================================+
# File name : image.rb
# Begin : 2002-07-31
diff --git a/lib/core/mini_magick.rb b/lib/core/mini_magick.rb
index 591a535d..77a11da0 100644
--- a/lib/core/mini_magick.rb
+++ b/lib/core/mini_magick.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
# The MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/lib/core/rmagick.rb b/lib/core/rmagick.rb
index 3f546fb6..ee498591 100644
--- a/lib/core/rmagick.rb
+++ b/lib/core/rmagick.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
# The MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/lib/htmlcolors.rb b/lib/htmlcolors.rb
index e3039971..acd81872 100755
--- a/lib/htmlcolors.rb
+++ b/lib/htmlcolors.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
#============================================================+
# File name : htmlcolors.rb
# Begin : 2002-04-09
diff --git a/lib/rbpdf.rb b/lib/rbpdf.rb
index b5020da0..03a32251 100755
--- a/lib/rbpdf.rb
+++ b/lib/rbpdf.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
#============================================================+
# File name : rbpdf.rb
# Begin : 2002-08-03
@@ -342,7 +343,7 @@ def initialize(orientation = 'P', unit = 'mm', format = 'A4', unicode = true, e
@outlines ||= []
# --- javascript and form ---
- @javascript ||= ''
+ @javascript ||= +''
@js_objects ||= {}
@js_start_obj_id ||= 300000
@js_obj_id ||= 300000
@@ -454,7 +455,7 @@ def initialize(orientation = 'P', unit = 'mm', format = 'A4', unicode = true, e
if @diskcache
@buffer ||= nil
else
- @buffer ||= ''
+ @buffer ||= +''
end
@tmp_buffer = nil
@pages ||= []
@@ -2647,11 +2648,11 @@ def AddFont(family, style='', fontfile='', subset=nil)
family = 'helvetica';
end
if (family == "symbol") or (family == "zapfdingbats")
- style = ''
+ style = +''
end
tempstyle = style.upcase
- style = ''
+ style = +''
# underline
if tempstyle.index('U') != nil
@underline = true
@@ -3452,8 +3453,8 @@ def Cell(w, h=0, txt='', border=0, ln=0, align='', fill=0, link=nil, stretch=0,
# [@see] Cell()
#
def getCellCode(w, h=0, txt='', border=0, ln=0, align='', fill=0, link=nil, stretch=0, ignore_min_height=false, calign='T', valign='M')
- txt = '' if txt.nil?
- rs = "" # string to be returned
+ txt = +'' if txt.nil?
+ rs = +"" # string to be returned
txt = removeSHY(txt)
if !ignore_min_height
min_cell_height = @font_size * @cell_height_ratio
@@ -3535,7 +3536,7 @@ def getCellCode(w, h=0, txt='', border=0, ln=0, align='', fill=0, link=nil, stre
w = @w - @r_margin - x
end
end
- s = '';
+ s = +'';
# fill and borders
if (fill == 1) or (border.to_i == 1)
if (fill == 1)
@@ -4081,7 +4082,7 @@ def getBorderMode(border, position='start')
return 1
end
return 0 if border == 0
- cborder = ''
+ cborder = +''
case position
when 'start'
if border == 1
@@ -4676,7 +4677,7 @@ def getRemainingWidth()
# [@access public]
#
def UTF8ArrSubString(strarr, start=0, last=strarr.size)
- string = ""
+ string = +""
start.upto(last - 1) do |i|
string << unichr(strarr[i])
end
@@ -4694,7 +4695,7 @@ def UTF8ArrSubString(strarr, start=0, last=strarr.size)
# [@since 4.5.037 (2009-04-07)]
#
def UniArrSubString(uniarr, start=0, last=uniarr.length)
- string = ''
+ string = +''
start.upto(last - 1) do |i|
string << uniarr[i]
end
@@ -5146,7 +5147,7 @@ def parsejpeg(file)
end
bpc=!a['bits'].nil? ? a['bits'] : 8;
#Read whole file
- data='';
+ data=+'';
open(file,'rb') do |f|
data << f.read()
end
@@ -5259,9 +5260,9 @@ def parsepng(file)
f.read(4)
parms='/DecodeParms <>'
# Scan chunks looking for palette, transparency and image data
- pal = ''
- trns = ''
- data = ''
+ pal = +''
+ trns = +''
+ data = +''
begin
n = freadint(f)
type = f.read(4)
@@ -5856,7 +5857,7 @@ def putpages()
temppage = temppage.gsub(@epsmarker, '')
#Page
@page_obj_id[n] = newobj()
- out = '<<'
+ out = +'<<'
out << ' /Type /Page'
out << ' /Parent 1 0 R'
out << ' /LastModified ' + datestring()
@@ -5946,7 +5947,7 @@ def putpages()
end
#Pages root
@offsets[1]=@bufferlen
- out = '1 0 obj << /Type /Pages /Kids ['
+ out = +'1 0 obj << /Type /Pages /Kids ['
@page_obj_id.each { |page_obj|
out << ' ' + page_obj.to_s + ' 0 R' unless page_obj.nil?
}
@@ -5976,9 +5977,9 @@ def putannotsrefs(n)
#
def getannotsrefs(n)
unless @page_annots[n] or (@sign and @signature_data['cert_type'])
- return ''
+ return +''
end
- out = ' /Annots ['
+ out = +' /Annots ['
if @page_annots[n]
num_annots = @page_annots[n].length
0.upto(num_annots - 1) do |i|
@@ -6016,7 +6017,7 @@ def putannotsobjs()
@page_annots[n].each_with_index { |pl, key|
# create annotation object for grouping radiobuttons
if @radiobutton_groups[n] and @radiobutton_groups[n][pl['txt']] and @radiobutton_groups[n][pl['txt']].is_a?(Array)
- annots = '<<'
+ annots = +'<<'
annots << ' /Type /Annot'
annots << ' /Subtype /Widget'
annots << ' /T ' + dataannobjstring(pl['txt'])
@@ -6052,7 +6053,7 @@ def putannotsobjs()
d = pl['h'] * @k
rect = sprintf('%.2f %.2f %.2f %.2f', a, b, a + c, b + d)
# create new annotation object
- annots = '<> endobj'
out(out)
newobj()
- out = '<> endobj'
out(out)
@@ -10828,14 +10829,14 @@ def TextField(name, w, h, prop = {}, opt = {}, x = '', y = '', js = false)
if opt['v'] && !empty_string(opt['v'])
# set Appearances
- popt['ap']['n'] = "/Tx BMC q #{fontstyle} "
+ popt['ap']['n'] = +"/Tx BMC q #{fontstyle} "
gvars = getGraphicVars()
@h = h
@w = w
@t_margin = 0
@c_margin = 0.2
- @tmp_buffer = ''
+ @tmp_buffer = +''
multi_cell(w, h, opt['v'], 0, '', 0, 0, 0.2, 0, true, 0, false, true, 0)
popt['ap']['n'] << @tmp_buffer
@tmp_buffer = nil
@@ -10996,7 +10997,7 @@ def ListBox(name, w, h, values, prop = {}, opt = {}, x = '', y = '', js = false)
if js
addfield('listbox', name, x, y, w, h, prop)
- s = ''
+ s = +''
values.each {|v|
if v.is_a?(Array)
s << "['#{v[0]}','#{v[1]}'],"
@@ -11017,7 +11018,7 @@ def ListBox(name, w, h, values, prop = {}, opt = {}, x = '', y = '', js = false)
unless @annotation_fonts.include? fontkey
@annotation_fonts[font] = fontkey
end
- s = ''
+ s = +''
values.each {|v|
if v.is_a?(Array)
s << "#{v[1]}\n"
@@ -11030,14 +11031,14 @@ def ListBox(name, w, h, values, prop = {}, opt = {}, x = '', y = '', js = false)
popt['da'] = fontstyle
popt['ap'] = {}
# set Appearances
- popt['ap']['n'] = "/Tx BMC q #{fontstyle} "
+ popt['ap']['n'] = +"/Tx BMC q #{fontstyle} "
gvars = getGraphicVars()
@h = h
@w = w
@t_margin = 0
@c_margin = 0.2
- @tmp_buffer = ''
+ @tmp_buffer = +''
multi_cell(w, h, s, 0, '', 0, 0, 0.2, 0, true, 0, false, true, 0)
popt['ap']['n'] << @tmp_buffer
popt['ap']['n'] << 'Q EMC'
@@ -11083,7 +11084,7 @@ def ComboBox(name, w, h, values, prop = {}, opt = {}, x = '', y = '', js = false
if js
addfield('combobox', name, x, y, w, h, prop)
- s = ''
+ s = +''
values.each {|v|
if v.is_a?(Array)
s << "['#{v[0]}','#{v[1]}'],"
@@ -11106,7 +11107,7 @@ def ComboBox(name, w, h, values, prop = {}, opt = {}, x = '', y = '', js = false
@annotation_fonts[font] = fontkey
end
- s = ''
+ s = +''
values.each {|v|
if v.is_a?(Array)
s << "#{v[1]}\n"
@@ -11118,14 +11119,14 @@ def ComboBox(name, w, h, values, prop = {}, opt = {}, x = '', y = '', js = false
popt['da'] = fontstyle
popt['ap'] = {}
# set Appearances
- popt['ap']['n'] = "/Tx BMC q #{fontstyle} "
+ popt['ap']['n'] = +"/Tx BMC q #{fontstyle} "
gvars = getGraphicVars()
@h = h
@w = w
@t_margin = 0
@c_margin = 0.2
- @tmp_buffer = ''
+ @tmp_buffer = +''
multi_cell(w, h, s, 0, '', 0, 0, 0.2, 0, true, 0, false, true, 0)
popt['ap']['n'] << @tmp_buffer
popt['ap']['n'] << 'Q EMC'
@@ -11269,14 +11270,14 @@ def Button(name, w, h, caption, action, prop = {}, opt = {}, x = '', y = '', js
popt['da'] = fontstyle
popt['ap'] = {}
# set Appearances
- popt['ap']['n'] = "/Tx BMC q #{fontstyle} 0.800 g\n"
+ popt['ap']['n'] = +"/Tx BMC q #{fontstyle} 0.800 g\n"
gvars = getGraphicVars()
@h = h
@w = w
@c_margin *= 1.6
- @tmp_buffer = ''
+ @tmp_buffer = +''
SetLineStyle({'width' => 1.0, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => [231]})
SetFillColor(204)
multi_cell(w, h, caption, 1, 'C', 1, 0, 0, 0, true)
@@ -11297,7 +11298,7 @@ def Button(name, w, h, caption, action, prop = {}, opt = {}, x = '', y = '', js
unless action.empty?
if action.is_a?(Hash)
# form action options as on section 12.7.5 of PDF32000_2008.
- opt['aa'] = '/D <<'
+ opt['aa'] = +'/D <<'
bmode = ['SubmitForm', 'ResetForm', 'ImportData']
action.each {|key, val|
if (key == 'S') && bmode.include?(val)
@@ -11608,7 +11609,7 @@ def putextgstates()
newobj()
@extgstates[i] ||= {}
@extgstates[i]['n'] = @n
- out = '<< /Type /ExtGState'
+ out = +'<< /Type /ExtGState'
if @extgstates[i]['parms']
@extgstates[i]['parms'].each {|k, v|
if v.is_a? Float
@@ -11846,7 +11847,7 @@ def CoonsPatchMesh(x, y, w, h, col1=[], col2=[], col3=[], col4=[], coords=[0.00,
end
bpcd = 65535 #16 bits per coordinate
# build the data stream
- @gradients[n]['stream'] = ''
+ @gradients[n]['stream'] = +''
count_patch = patch_array.size
count_patch.times do |i|
@gradients[n]['stream'] << (patch_array[i]['f']).chr # start with the edge flag as 8 bit
@@ -11891,7 +11892,7 @@ def Clip(x, y, w, h)
x = @w - x - w if @rtl
# save current Graphic State
- s = 'q'
+ s = +'q'
# set clipping area
s << sprintf(' %.2f %.2f %.2f %.2f re W n', x * @k, (@h - y) * @k, w * @k, -h * @k)
# set up transformation matrix for gradient
@@ -12004,12 +12005,12 @@ def putshaders()
if (grad['type'] == 2) || (grad['type'] == 3)
newobj()
fc = @n
- out = '<<'
+ out = +'<<'
out << ' /FunctionType 3'
out << ' /Domain [0 1]'
- functions = ''
- bounds = ''
- encode = ''
+ functions = +''
+ bounds = +''
+ encode = +''
i = 1
num_cols = grad['colors'].size
lastcols = num_cols - 1
@@ -12028,7 +12029,7 @@ def putshaders()
out(out)
1.upto(num_cols - 1) do |i|
newobj()
- out = '<<'
+ out = +'<<'
out << ' /FunctionType 2'
out << ' /Domain [0 1]'
out << " /C0 [#{grad['colors'][i - 1]['color']}]"
@@ -12042,7 +12043,7 @@ def putshaders()
if grad['transparency']
newobj()
ft = @n
- out = '<<'
+ out = +'<<'
out << ' /FunctionType 3'
out << ' /Domain [0 1]'
functions = ''
@@ -12059,7 +12060,7 @@ def putshaders()
out(out)
1.upto(num_cols - 1) do |i|
newobj()
- out = '<<'
+ out = +'<<'
out << ' /FunctionType 2'
out << ' /Domain [0 1]'
out << " /C0 [#{grad['colors'][(i - 1)]['opacity']}]"
@@ -12073,7 +12074,7 @@ def putshaders()
end
# set shading object
newobj()
- out = "<< /ShadingType #{grad['type']}"
+ out = +"<< /ShadingType #{grad['type']}"
if grad['colspace']
out << " /ColorSpace /#{grad['colspace']}"
else
@@ -12117,7 +12118,7 @@ def putshaders()
@gradients[id]['id'] = @n
# set pattern object
newobj()
- out = '<< /Type /Pattern /PatternType 2'
+ out = +'<< /Type /Pattern /PatternType 2'
out << " /Shading #{@gradients[id]['id']} 0 R"
out << ' >> endobj'
out(out)
@@ -12131,7 +12132,7 @@ def putshaders()
@gradients[idgs] = {}
@gradients[idgs]['id'] = @n
newobj()
- out = '<< /Type /Pattern /PatternType 2'
+ out = +'<< /Type /Pattern /PatternType 2'
out << " /Shading #{@gradients[idgs]['id']} 0 R"
out << ' >> endobj'
out(out)
@@ -12144,7 +12145,7 @@ def putshaders()
filter = ' /Filter /FlateDecode'
stream = Zlib::Deflate.deflate(stream)
end
- out = "<< /Type /XObject /Subtype /Form /FormType 1#{filter}"
+ out = +"<< /Type /XObject /Subtype /Form /FormType 1#{filter}"
out << " /Length #{stream.length}"
out << " /BBox [0 0 #{@w_pt} #{@h_pt}]"
out << ' /Group << /Type /Group /S /Transparency /CS /DeviceGray >>'
@@ -12158,11 +12159,11 @@ def putshaders()
out(out)
# SMask
newobj()
- out = "<< /Type /Mask /S /Luminosity /G #{@n - 1} 0 R >> endobj"
+ out = +"<< /Type /Mask /S /Luminosity /G #{@n - 1} 0 R >> endobj"
out(out)
# ExtGState
newobj()
- out = "<< /Type /ExtGState /SMask #{@n - 1} 0 R /AIS false >> endobj"
+ out = +"<< /Type /ExtGState /SMask #{@n - 1} 0 R /AIS false >> endobj"
out(out)
@extgstates << {'n' => @n, 'name' => "TGS#{id}"}
end
@@ -12638,7 +12639,7 @@ def isValidCSSSelectorForTag(dom, key, selector)
# [@since 5.1.000 (2010-05-25)]
#
def getTagStyleFromCSS(dom, key, css)
- tagstyle = '' # style to be returned
+ tagstyle = +'' # style to be returned
# get all styles that apply
css.each { |selector, style|
# remove specificity
@@ -12926,7 +12927,7 @@ def getHtmlDomArray(html)
dom[grandparent]['cols'] = dom[(dom[key]['parent'])]['cols']
end
if (dom[key]['value'] == 'td') or (dom[key]['value'] == 'th')
- dom[(dom[key]['parent'])]['content'] = ''
+ dom[(dom[key]['parent'])]['content'] = +''
(dom[key]['parent'] + 1).upto(key - 1) do |i|
dom[(dom[key]['parent'])]['content'] << a[dom[i]['elkey']]
end
@@ -14391,7 +14392,7 @@ def writeHTML(html, ln=true, fill=0, reseth=false, cell=false, align='')
len1 = dom[key]['value'].length
lsp = len1 - dom[key]['value'].lstrip.length
rsp = len1 - dom[key]['value'].rstrip.length
- tmpstr = ''
+ tmpstr = +''
if rsp > 0
tmpstr << dom[key]['value'][-rsp..-1]
end
@@ -15729,7 +15730,7 @@ def intToRoman(number)
#
def putHtmlListBullet(listdepth, listtype='', size=10)
size /= @k
- fill = ''
+ fill = +''
color = @fgcolor
width = 0
textitem = ''
@@ -15748,7 +15749,7 @@ def putHtmlListBullet(listdepth, listtype='', size=10)
# unordered types
when 'none'
when 'disc', 'circle'
- fill = 'F' if listtype == 'disc'
+ fill = +'F' if listtype == 'disc'
fill << 'D'
r = size / 6.0
lspace += 2 * r
@@ -15961,7 +15962,7 @@ def writeDiskCache(filename, data, append=false)
#
def readDiskCache(filename)
filename = filename.path
- data = ''
+ data = +''
open( filename,'rb') do |f|
data << f.read()
end
diff --git a/lib/rbpdf/action_controller.rb b/lib/rbpdf/action_controller.rb
index 503f6cae..bee26f34 100644
--- a/lib/rbpdf/action_controller.rb
+++ b/lib/rbpdf/action_controller.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Rbpdf
module ActionController
diff --git a/lib/rbpdf/action_view.rb b/lib/rbpdf/action_view.rb
index 949b77a5..5b014932 100644
--- a/lib/rbpdf/action_view.rb
+++ b/lib/rbpdf/action_view.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Rbpdf
module ActionView
diff --git a/lib/rbpdf/errors.rb b/lib/rbpdf/errors.rb
index ba721bc7..a1c02ff1 100644
--- a/lib/rbpdf/errors.rb
+++ b/lib/rbpdf/errors.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Rbpdf
module Errors
class GenerationError < StandardError #:nodoc:
diff --git a/lib/rbpdf/template_handler/compile_support.rb b/lib/rbpdf/template_handler/compile_support.rb
index bf1d1c8c..cf930dae 100644
--- a/lib/rbpdf/template_handler/compile_support.rb
+++ b/lib/rbpdf/template_handler/compile_support.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Rbpdf
module TemplateHandler
diff --git a/lib/rbpdf/template_handlers/base.rb b/lib/rbpdf/template_handlers/base.rb
index df55a10c..a6a84964 100644
--- a/lib/rbpdf/template_handlers/base.rb
+++ b/lib/rbpdf/template_handlers/base.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
module Rbpdf
module TemplateHandlers
if defined? ::ActionView::TemplateHandlers
diff --git a/lib/rbpdf/version.rb b/lib/rbpdf/version.rb
index 100094b5..65dce08f 100644
--- a/lib/rbpdf/version.rb
+++ b/lib/rbpdf/version.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/err_font1.rb b/test/err_font1.rb
index 5e0a591c..6b707a9a 100644
--- a/test/err_font1.rb
+++ b/test/err_font1.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/err_font2.rb b/test/err_font2.rb
index 30eda16c..02b59556 100644
--- a/test/err_font2.rb
+++ b/test/err_font2.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_annotation_test.rb b/test/rbpdf_annotation_test.rb
index 8c5f75f8..f357e2b9 100644
--- a/test/rbpdf_annotation_test.rb
+++ b/test/rbpdf_annotation_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_bidi_test.rb b/test/rbpdf_bidi_test.rb
index 5ef1be1d..86b23a68 100644
--- a/test/rbpdf_bidi_test.rb
+++ b/test/rbpdf_bidi_test.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
#
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
@@ -81,7 +82,7 @@ def get_current_font
utf8_chr = pdf.unichr(0x61)
assert_equal "a", utf8_chr
utf8_chr = pdf.unichr(0x5e2)
- assert_equal "\xd7\xa2", utf8_chr
+ assert_equal (+"\xd7\xa2").force_encoding("ASCII-8BIT"), utf8_chr
# UTF-8 string -> array of UCS4 charactor
ary_ucs4 = pdf.UTF8StringToArray("abc")
@@ -261,7 +262,7 @@ def get_current_font
# UCS4 charactor -> UTF-8 charactor
utf8_chr = pdf.unichr(0x62f)
- assert_equal "\xd8\xaf", utf8_chr
+ assert_equal (+"\xd8\xaf").force_encoding("ASCII-8BIT"), utf8_chr
# UTF-8 string -> array of UCS4 charactor
ary_ucs4 = pdf.UTF8StringToArray(ascii_str)
diff --git a/test/rbpdf_bookmark_test.rb b/test/rbpdf_bookmark_test.rb
index 7010eebb..e4568467 100644
--- a/test/rbpdf_bookmark_test.rb
+++ b/test/rbpdf_bookmark_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_cell_test.rb b/test/rbpdf_cell_test.rb
index 5a114073..39142306 100644
--- a/test/rbpdf_cell_test.rb
+++ b/test/rbpdf_cell_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2018 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
@@ -220,11 +221,11 @@ class RbpdfTest < Test::Unit::TestCase
pdf = RBPDF.new('P', 'mm', 'A4', true, "UTF-8", true)
- str = 'test'.force_encoding('UTF-8')
+ str = (+'test').force_encoding('UTF-8')
pdf.removeSHY(str)
assert_equal 'UTF-8', str.encoding.to_s
- str = 'test'.force_encoding('ASCII-8BIT')
+ str = (+'test').force_encoding('ASCII-8BIT')
pdf.removeSHY(str)
assert_equal 'ASCII-8BIT', str.encoding.to_s
end
diff --git a/test/rbpdf_content_test.rb b/test/rbpdf_content_test.rb
index 57129ebf..bb390398 100644
--- a/test/rbpdf_content_test.rb
+++ b/test/rbpdf_content_test.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
#
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
diff --git a/test/rbpdf_css_test.rb b/test/rbpdf_css_test.rb
index 1e5edeab..29910c3a 100644
--- a/test/rbpdf_css_test.rb
+++ b/test/rbpdf_css_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_dom_test.rb b/test/rbpdf_dom_test.rb
index c2d08a39..dfffa601 100644
--- a/test/rbpdf_dom_test.rb
+++ b/test/rbpdf_dom_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
@@ -278,7 +279,7 @@ def get_temp_rtl
return unless 'test'.respond_to?(:force_encoding)
pdf = RBPDF.new('P', 'mm', 'A4', true, "UTF-8", true)
- htmlcontent = 'test'.force_encoding('ASCII-8BIT')
+ htmlcontent = (+'test').force_encoding('ASCII-8BIT')
pdf.send(:getHtmlDomArray, htmlcontent)
assert_equal 'ASCII-8BIT', htmlcontent.encoding.to_s
end
diff --git a/test/rbpdf_examples_test.rb b/test/rbpdf_examples_test.rb
index 0777d93b..fbe3d916 100644
--- a/test/rbpdf_examples_test.rb
+++ b/test/rbpdf_examples_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2018 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_font_func_test.rb b/test/rbpdf_font_func_test.rb
index c4c3f99c..4f127bfd 100644
--- a/test/rbpdf_font_func_test.rb
+++ b/test/rbpdf_font_func_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_font_style_test.rb b/test/rbpdf_font_style_test.rb
index 8672c1e0..7b745f40 100644
--- a/test/rbpdf_font_style_test.rb
+++ b/test/rbpdf_font_style_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_font_test.rb b/test/rbpdf_font_test.rb
index 826c4a96..5910a019 100644
--- a/test/rbpdf_font_test.rb
+++ b/test/rbpdf_font_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_form_func_test.rb b/test/rbpdf_form_func_test.rb
index ffb12b15..c8d1e4a4 100644
--- a/test/rbpdf_form_func_test.rb
+++ b/test/rbpdf_form_func_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# coding: ASCII-8BIT
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
@@ -113,7 +114,7 @@ def addfield_result(type, name, x, y, w, h, pdf)
@h = pdf.get_page_height
k = pdf.get_scale_factor
font_size_pt = pdf.get_font_size_pt
- <<~EOS
+ +<<~EOS
if(getField('tcpdfdocsaved').value != 'saved') {f#{name}=this.addField('#{name}','#{type}',#{pdf.PageNo() - 1},[#{sprintf("%.2f,%.2f,%.2f,%.2f", x * k, (@h - y) * k + 1, (x + w) * k, (@h - y - h) * k + 1)}]);
f#{name}.textSize=#{font_size_pt};
EOS
diff --git a/test/rbpdf_format_test.rb b/test/rbpdf_format_test.rb
index bb942aaa..3ef7b69a 100644
--- a/test/rbpdf_format_test.rb
+++ b/test/rbpdf_format_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_func_test.rb b/test/rbpdf_func_test.rb
index 97e6b81e..38556316 100644
--- a/test/rbpdf_func_test.rb
+++ b/test/rbpdf_func_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
@@ -132,7 +133,7 @@ def getSpaceString
return unless 'test'.respond_to?(:force_encoding)
pdf = RBPDF.new
- str = 'test'.force_encoding('UTF-8')
+ str = (+'test').force_encoding('UTF-8')
pdf.get_string_width(str)
assert_equal 'UTF-8', str.encoding.to_s
end
diff --git a/test/rbpdf_gradient_test.rb b/test/rbpdf_gradient_test.rb
index 75d355d4..6dda1ddc 100644
--- a/test/rbpdf_gradient_test.rb
+++ b/test/rbpdf_gradient_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
@@ -98,7 +99,7 @@ def getPageBuffer(page)
contents.each_line {|line| content.push line.chomp }
assert_equal "<< /ShadingType 6 /ColorSpace /DeviceRGB /BitsPerCoordinate 16 /BitsPerComponent 8 /Decode[0 1 0 1 0 1 0 1 0 1] /BitsPerFlag 8 /Length 61 >> stream", content[before_size + 1]
- assert_equal "\x00\x00\x00\x00\x00Tz33\xAB\x84\x00\x00\xFF\xFF\x00\x00\xCC\xCCTz\xCC\xCC\xAB\x84\xFF\xFF\xFF\xFF\xAB\x84\xCC\xCCTz\xFF\xFF\x00\x00\xFF\xFF33\xAB\x84\x00\x00Tz\xFF\xFF\x00\x00\x00\xC8\x00\xFF\x00\xFF\x00\x00".force_encoding('ASCII-8BIT'), content[before_size + 2]
+ assert_equal (+"\x00\x00\x00\x00\x00Tz33\xAB\x84\x00\x00\xFF\xFF\x00\x00\xCC\xCCTz\xCC\xCC\xAB\x84\xFF\xFF\xFF\xFF\xAB\x84\xCC\xCCTz\xFF\xFF\x00\x00\xFF\xFF33\xAB\x84\x00\x00Tz\xFF\xFF\x00\x00\x00\xC8\x00\xFF\x00\xFF\x00\x00").force_encoding('ASCII-8BIT'), content[before_size + 2]
assert_equal "endstream endobj", content[before_size + 3]
assert_equal "<< /Type /Pattern /PatternType 2 /Shading 3 0 R >> endobj", content[before_size + 5]
end
diff --git a/test/rbpdf_graphic_func_test.rb b/test/rbpdf_graphic_func_test.rb
index 3e81bd77..b4f8a9ee 100644
--- a/test/rbpdf_graphic_func_test.rb
+++ b/test/rbpdf_graphic_func_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_html_anchor_test.rb b/test/rbpdf_html_anchor_test.rb
index 5e31e18c..46921778 100644
--- a/test/rbpdf_html_anchor_test.rb
+++ b/test/rbpdf_html_anchor_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_html_form_test.rb b/test/rbpdf_html_form_test.rb
index 19074b9e..e7605111 100644
--- a/test/rbpdf_html_form_test.rb
+++ b/test/rbpdf_html_form_test.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
#
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
diff --git a/test/rbpdf_html_func_test.rb b/test/rbpdf_html_func_test.rb
index deee647d..7a9186c3 100644
--- a/test/rbpdf_html_func_test.rb
+++ b/test/rbpdf_html_func_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_html_test.rb b/test/rbpdf_html_test.rb
index 97643e4e..de6dce19 100644
--- a/test/rbpdf_html_test.rb
+++ b/test/rbpdf_html_test.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
#
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
@@ -55,7 +56,7 @@ def get_html_text(page)
content = []
contents = getPageBuffer(page)
contents.each_line {|line| content.push line.chomp }
- pdf_text = ''
+ pdf_text = +''
content.each do |line|
if line =~ /\[\((.*)\)\] TJ ET/
pdf_text << $1
diff --git a/test/rbpdf_htmlcell_test.rb b/test/rbpdf_htmlcell_test.rb
index 182853c8..39f232ff 100644
--- a/test/rbpdf_htmlcell_test.rb
+++ b/test/rbpdf_htmlcell_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2018 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_http_test.rb b/test/rbpdf_http_test.rb
index 16ceaa10..4edfb3ec 100644
--- a/test/rbpdf_http_test.rb
+++ b/test/rbpdf_http_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_image_rmagick_test.rb b/test/rbpdf_image_rmagick_test.rb
index 7ad8062a..97014e52 100644
--- a/test/rbpdf_image_rmagick_test.rb
+++ b/test/rbpdf_image_rmagick_test.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
# Copyright (c) 2011-2023 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_image_test.rb b/test/rbpdf_image_test.rb
index 6243d3c1..bb1cc0b9 100644
--- a/test/rbpdf_image_test.rb
+++ b/test/rbpdf_image_test.rb
@@ -1,4 +1,5 @@
# coding: ASCII-8BIT
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_test.rb b/test/rbpdf_test.rb
index 47f67973..784ed2c5 100644
--- a/test/rbpdf_test.rb
+++ b/test/rbpdf_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_transaction_test.rb b/test/rbpdf_transaction_test.rb
index f31f097b..f811b326 100644
--- a/test/rbpdf_transaction_test.rb
+++ b/test/rbpdf_transaction_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_viewerpreferences_test.rb b/test/rbpdf_viewerpreferences_test.rb
index 7f440773..5a486c57 100644
--- a/test/rbpdf_viewerpreferences_test.rb
+++ b/test/rbpdf_viewerpreferences_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
diff --git a/test/rbpdf_write_test.rb b/test/rbpdf_write_test.rb
index 20d4ca6f..64e1d8b2 100644
--- a/test/rbpdf_write_test.rb
+++ b/test/rbpdf_write_test.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
@@ -178,7 +179,7 @@ def r_margin
return unless 'test'.respond_to?(:force_encoding)
pdf = RBPDF.new('P', 'mm', 'A4', true, "UTF-8", true)
- str = 'test'.force_encoding('UTF-8')
+ str = (+'test').force_encoding('UTF-8')
pdf.write(0, str)
assert_equal 'UTF-8', str.encoding.to_s
end