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

Blankslate Ruby 3.0 compatibility #13

Closed
voxik opened this issue Feb 1, 2021 · 2 comments
Closed

Blankslate Ruby 3.0 compatibility #13

voxik opened this issue Feb 1, 2021 · 2 comments

Comments

@voxik
Copy link

voxik commented Feb 1, 2021

Testing with Ruby 3.0, I observe the following error:

$ ruby -Ilib:test -e 'Dir.glob "./test/test_blan*.rb", &method(:require)' -- -n /test_late_included_module_in_kernel_is_ok/
Run options: -n /test_late_included_module_in_kernel_is_ok/ --seed 30445

# Running:

F

Finished in 0.000934s, 1070.2879 runs/s, 1070.2879 assertions/s.

  1) Failure:
TestBlankSlate#test_late_included_module_in_kernel_is_ok [/builddir/build/BUILD/builder-3.2.4/usr/share/gems/gems/builder-3.2.4/test/test_blankslate.rb:149]:
NoMethodError expected but nothing was raised.

1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
@voxik
Copy link
Author

voxik commented Mar 16, 2021

I think this is probably related to the ruby-core#9573 and this fixes the test case:

$ git diff
diff --git a/lib/blankslate.rb b/lib/blankslate.rb
index 7ea1864..b974f40 100644
--- a/lib/blankslate.rb
+++ b/lib/blankslate.rb
@@ -129,7 +129,7 @@ class Module
   alias blankslate_original_append_features append_features
   def append_features(mod)
     result = blankslate_original_append_features(mod)
-    return result if mod != Object
+    return result if (mod != Object && mod != Kernel)
     instance_methods.each do |name|
       BlankSlate.hide(name)
     end

However, I am not quite sure this is the right fix.

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Mar 20, 2021
...from rails/builder#13

git-svn-id: file:///srv/repos/svn-community/svn@895591 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Mar 20, 2021
...from rails/builder#13




git-svn-id: file:///srv/repos/svn-community/svn@895591 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@byroot
Copy link
Member

byroot commented Jun 6, 2024

Fixed in #15

@byroot byroot closed this as completed Jun 6, 2024
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

2 participants