Closed UliKuch closed 3 years ago
Because of this, I can no longer include any modules inside a notebook.
Could you please explain more about this point?
Could you please explain more about this point?
If, inside a notebook, I try including a module, I receive a NoMethodError
:
module Foo
def bar
puts "baz"
end
end
include Foo
# NoMethodError: undefined method `include' for #<Object:0x00007f87fc58d960 @prompt={:PROMPT_I=>"3.0.1 :%03n > ", :PROMPT_S=>"3.0.1 :%03n%l> ", :PROMPT_C=>"3.0.1 :%03n > ", :PROMPT_N=>"3.0.1 :%03n?> ", :RETURN=>" => %s \n", :AUTO_INDENT=>true}>
# (irb):in `<main>'
In version 0.5, this used to work fine. And in any regular irb shell it works, too.
Extending the module instead seems to work though:
extend Foo
# #<Object:0x00007f87fc58d960 @prompt={:PROMPT_I=>"3.0.1 :%03n > ", :PROMPT_S=>"3.0.1 :%03n%l> ", :PROMPT_C=>"3.0.1 :%03n > ", :PROMPT_N=>"3.0.1 :%03n?> ", :RETURN=>" => %s \n", :AUTO_INDENT=>true}>
bar
# baz
I see. I understand. I was not aware of this problem.
@UliKuch Thank you for reporting this issue. This is bug. I'll fix it asap.
@UliKuch Please try the version 0.7.2.
Works great! Thanks!
Including a module now works fine, thanks a lot @mrkn !
Hi! Thanks for maintaining this Gem, I really enjoy using Jupyter notebooks with Ruby 🙂
Unfortunately, when using the
PlainBackend
in version 0.6 or 0.7 together with Ruby 3.0.1, I am having issues with theself
object. It no longer evaluates tomain
, but to some other object: As I verified by running the line in an irb session, the object seems to be the one created by https://github.com/SciRuby/iruby/blob/fb20cc30c2cb6e104b5398a6a6d907c699743b5a/lib/iruby/backend.rb#L42Because of this, I can no longer include any modules inside a notebook.
When I remove the
dup
in the quoted line, everything seemed to work fine, but I am not sure if that breaks anything else.Or am I missing some error on my part here? I am running my notebooks via the jupyter_on_rails gem, but the issue does not seem to lie there.