You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(DISCLAIMER: Sorry if it is my lack of knowledge of Ruby that is at fault here. It is actually very likely. Please accept my apologies in advance if it's the case.)
Ruby crashes with a strange error, like if the extent array was empty or such, whenever the font size in my extent is 6.7. it doesnt when the size is 7.
(only 7 is changed by 6.7. tried with 6.8 and other values to the same... extent < pun intended)
error is:
peoject.rb:83:in block (2 levels) in <main>': undefined method <<' for nil (NoMethodError)
arr << ext[:height]+620 ; arr
^^
from project.rb:78:in `each'
from project.rb:78:in `inject'
from project.rb:78:in `block in <main>'
from /usr/local/bundle/gems/squib-0.19.0/lib/squib/deck.rb:75:in `instance_eval'
from /usr/local/bundle/gems/squib-0.19.0/lib/squib/deck.rb:75:in `initialize'
from project.rb:12:in `new'
from project.rb:12:in `<main>'
Describe the bug
(DISCLAIMER: Sorry if it is my lack of knowledge of Ruby that is at fault here. It is actually very likely. Please accept my apologies in advance if it's the case.)
Ruby crashes with a strange error, like if the extent array was empty or such, whenever the font size in my extent is 6.7. it doesnt when the size is 7.
To Reproduce
WHAT WORKS:
extents = text(str: cards['desc'], font: 'TradeGothic 7', x:100, width:570, height: 235, color: '#0000')
puts extents
ws = extents.inject([]) do |arr, ext|
case ext[:height]
when 0..80
arr << ext[:height]+640 ; arr
...etc.
(later:)
text str: cards['context'], y: ws, layout: "context"
WHAT DOESNT:
extents = text(str: cards['desc'], font: 'TradeGothic 6.7', x:100, width:570, height: 235, color: '#0000')
puts extents
ws = extents.inject([]) do |arr, ext|
case ext[:height]
when 0..80
arr << ext[:height]+640 ; arr
...etc.
(only 7 is changed by 6.7. tried with 6.8 and other values to the same... extent < pun intended)
error is:
peoject.rb:83:in
block (2 levels) in <main>': undefined method
<<' for nil (NoMethodError)I tried escaping the string with " " and with ' '
Expected behavior
not crashing! :)
Environment
Linux 238bcf6eaeeb 6.1.0-13-amd64 Allow config.yml to define custom colors #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux
ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
Additional context
none
Check the following:
The text was updated successfully, but these errors were encountered: