wvanbergen / chunky_png

Read/write access to PNG images in pure Ruby.
https://chunkypng.com
MIT License
1.05k stars 101 forks source link

Fixed functionality of #from_file within non-main Ractors, #170 #171

Open TheHashTableSlasher opened 1 year ago

TheHashTableSlasher commented 1 year ago

See issue #170 for more information. I tried to provide a useful spec to test this, but I'm pretty busy and didn't have time to set up a whole thing on the PC that I'm writing this from, so you may want to move it somewhere else or something.

wvanbergen commented 1 year ago

Looks like the test suite is showing some bitrot, but one failure seems to be related to this change:

/home/runner/work/chunky_png/chunky_png/spec/chunky_png/canvas_spec.rb:242:in `block (3 levels) in <top (required)>': undefined method `resource_file' for #<Ractor:#2 /home/runner/work/chunky_png/chunky_png/spec/chunky_png/canvas_spec.rb:242 running> (NoMethodError)

    img = Ractor.new { ChunkyPNG::Canvas.from_file(resource_file("operations.png")) }.take

Looks like the resource_file is not available in the Ractor context - can you look into it?

TheHashTableSlasher commented 1 year ago

Sorry, never used RSpec before. It oughtta work now though.