Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 3.0.0 compatability #52

Open
ripienaar opened this issue Dec 26, 2020 · 0 comments
Open

Ruby 3.0.0 compatability #52

ripienaar opened this issue Dec 26, 2020 · 0 comments

Comments

@ripienaar
Copy link
Contributor

ripienaar commented Dec 26, 2020

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant