Skip to content

Ruby 3.0.0 compatability #52

@ripienaar

Description

@ripienaar

This class modifies Process::Status at run time:

systemu/lib/systemu.rb

Lines 108 to 111 in c910f79

class << status
attr 'thread'
end
status.instance_eval{ @thread = thread }

But in Ruby 3 that object is frozen and cannot be modified

https://bugs.ruby-lang.org/issues/17269

irb(main):001:0> RUBY_VERSION
=> "3.0.0"
irb(main):002:0> systemu("ls") {|cid| p cid}[0].thread
NoMethodError (undefined method `thread' for #<Process::Status: pid 17667 exit 0>)

pre 3.0.0 this did:

irb(main):002:0> RUBY_VERSION
=> "2.7.2"
irb(main):003:0> systemu("ls") {|cid| p cid}[0].thread
17922
=> #<Thread:0x0000000002552d58 /home/rip/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/systemu-2.6.5/lib/systemu.rb:134 dead>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions