Closed rstammer closed 4 years ago
Hi @neumanrq
Thank you for your request.
IRuby dose not support magic commands. Magic commands have been discussed several times in the past. But for now, we're not going to support magic commands into IRuby.
The reason is that there are not many people to maintain IRuby and my skills are low. Other Jupyter kernels, such as IJulia, do not support magic commands too.
Another reason why we don't want to support magic commands is that in Ruby, sometimes line start with "%".
%w[apple banana orange strawberry]
%i[cat dog]
But, you can run simple Javascript like this.
IRuby.display('alert("Hey");', mime: "text/javascript")
Hi @kojix2,
thanks for your feedback and sharing your thoughts on that topic. The decision makes totally sense to me - I just did not know about the scope IRuby covers in this direction. The arguments against supporting the magic directives are really reasonable.
Also, thanks for your work on the project - I really appreciate this!
Jupyter supports executing JavaScript code inline by the directive
%%javascript
, i.e. a a cell withshould execute the JS code and produce the alert message box.
However, maybe I have overseen something - but I think unfortunately this does not work together with
iruby
yet:Here's how it should look like, as it does work with python3 kernel: