Skip to content

Commit 9344a9d

Browse files
authored
Merge pull request #106 from naitoh/frozen_string_update
Update frozen string literals
2 parents 724115c + fa96750 commit 9344a9d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/rbpdf.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,7 @@ def AddFont(family, style='', fontfile='', subset=nil)
26482648
family = 'helvetica';
26492649
end
26502650
if (family == "symbol") or (family == "zapfdingbats")
2651-
style = +''
2651+
style = ''
26522652
end
26532653

26542654
tempstyle = style.upcase
@@ -5695,7 +5695,7 @@ def destroy(destroyall=false, preserve_objcopy=false)
56955695
self.instance_variables.each { |val|
56965696
if destroyall or ((val != '@internal_encoding') and (val != '@state') and (val != '@bufferlen') and (val != '@buffer') and (val != '@diskcache') and (val != '@sign') and (val != '@signature_data') and (val != '@signature_max_length') and (val != '@byterange_string'))
56975697
if (!preserve_objcopy or (val.to_s != '@objcopy')) and !val.nil?
5698-
eval("#{val} = nil")
5698+
instance_variable_set(val, nil)
56995699
end
57005700
end
57015701
}
@@ -12046,7 +12046,7 @@ def putshaders()
1204612046
out = +'<<'
1204712047
out << ' /FunctionType 3'
1204812048
out << ' /Domain [0 1]'
12049-
functions = ''
12049+
functions = +''
1205012050
i = 1
1205112051
num_cols = grad['colors'].size
1205212052
1.upto(num_cols - 1) do |i|
@@ -12522,7 +12522,6 @@ def isValidCSSSelectorForTag(dom, key, selector)
1252212522
if dom[key]['attribute'] and dom[key]['attribute']['class'] and !dom[key]['attribute']['class'].empty?
1252312523
selector_class = dom[key]['attribute']['class'].downcase
1252412524
end
12525-
id = ''
1252612525
if dom[key]['attribute'] and dom[key]['attribute']['id'] and !dom[key]['attribute']['id'].empty?
1252712526
selector_id = dom[key]['attribute']['id'].downcase
1252812527
end
@@ -12709,7 +12708,7 @@ def getHtmlDomArray(html)
1270912708
uri.split('/').each {|path|
1271012709
uri_path = uri_path.join(path)
1271112710
}
12712-
cssdata = ''
12711+
cssdata = +''
1271312712
next unless File.exist?(uri_path)
1271412713

1271512714
open(uri_path) do |f|
@@ -13080,7 +13079,7 @@ def getHtmlDomArray(html)
1308013079
end
1308113080
end
1308213081
# font style
13083-
dom[key]['fontstyle'] ||= ""
13082+
dom[key]['fontstyle'] ||= +""
1308413083
if !dom[key]['style']['font-weight'].nil? and (dom[key]['style']['font-weight'][0,1].downcase == 'b')
1308513084
dom[key]['fontstyle'] << 'B'
1308613085
end
@@ -13618,8 +13617,8 @@ def writeHTML(html, ln=true, fill=0, reseth=false, cell=false, align='')
1361813617
# restore previous object
1361913618
rollbackTransaction(true)
1362013619
# restore previous values
13621-
this_method_vars.each {|vkey , vval|
13622-
eval("#{vkey} = vval")
13620+
this_method_vars.each {|vkey, vval|
13621+
binding.local_variable_set(vkey, vval)
1362313622
}
1362413623
# add a page (or trig AcceptPageBreak() for multicolumn mode)
1362513624
pre_y = @y
@@ -14482,7 +14481,7 @@ def writeHTML(html, ln=true, fill=0, reseth=false, cell=false, align='')
1448214481
rollbackTransaction(true)
1448314482
# restore previous values
1448414483
this_method_vars.each {|vkey , vval|
14485-
eval("#{vkey} = vval")
14484+
binding.local_variable_set(vkey, vval)
1448614485
}
1448714486
# add a page (or trig AcceptPageBreak() for multicolumn mode)
1448814487
pre_y = @y
@@ -16788,7 +16787,7 @@ def rollbackTransaction(this_self=false)
1678816787
if this_self
1678916788
objvars = @objcopy.instance_variables
1679016789
objvars.each {|key|
16791-
eval("#{key} = @objcopy.instance_variable_get(key)") if key.to_s != '@objcopy'
16790+
instance_variable_set(key, @objcopy.instance_variable_get(key)) if key.to_s != '@objcopy'
1679216791
}
1679316792
end
1679416793
return @objcopy

0 commit comments

Comments
 (0)