an analogue of ncurses for JRuby running in browser? - ruby

I want to run in the browser a ruby application using ncurses.
To do that, I can use JRuby; but what do I replace ncurses with ?
I am thinking of running JRuby as an applet as decribed here. I have also found some Jave
code 1 that does ncurses-like interface but I do not know how do I integrate it with JRuby.

I think it will be very hard to get something similar to ncurses in JRuby due to this particular issue that's been plaguing Java for ages. Please post in this thread if you'd like to see this fixed in the future.
http://bugs.sun.com/bugdatabase/view%5Fbug.do?bug%5Fid=6351276

Related

How can I create debian package (*.deb) from ruby application written with qt4?

I found a lot of tutorials how to build application with Ruby and Qt, but i have no idea how anybody else will be able to run it! I am using Ubuntu 11.10, ruby 1.9.2 with rvm and:
rbqtapi -v output "QtRuby 2.0.5 using Qt-4.7.4"
P.S. I have no idea how to build *.deb, it will be my first desktop app, not web.
please have a look on http://shoesrb.com/ this is the best way I heard off for writing GUI apps.
Shoes has now not it's greatest time, but we put our best time to make it better, give it a try and someone will help you.
In case you are in need of assistance just ask as question on #shoes IRC channel on freenode servers.
If you're sold on QT, then you will need your users to install all the support libraries for QT (and anything else), then you can upload a rubygem to rubygems.org for your users to download.
Once, they've installed the support libraries, you'd only need to update your rubygem, which is fairly quick and easy for updates.
You may also wan to look at visualruby. It uses GTK. Then you'd install the GTK libraries instead of the QT ones.
http://www.visualruby.net
As far as .deb packages go, I tried to research the same thing with little success. The rubygems packaging system is designed to distribute ruby programs, so it is the best way to go. Also, you'll need to install different support libraries for different platforms. If you look at visualruby's install page, you can see how to install GTK for Linux and Windows.
Good Luck.

JRuby & Win32OLE -- how well do they work together?

I've been using Win32OLE extensively with MRI to automate MS Office. It works great, but I'm thinking of switching to JRuby to simplify installing apps on users' systems.
With Win32OLE officially in JRuby 1.6, how well does it work? Should I be able to port my MRI-based app straight to JRuby without modification? Any hitches I should look out for?
Thanks.
We do have a win32ole extension built into JRuby. In fact, we also sport the only 64-bit version.
If you do find a bug or missing method or feature, please file an issue at http://bugs.jruby.org/ .

How reliable is JRuby?

I'm interested in promoting JRuby in our office as the platform hosting Rails applications.
But how reliable is it?
Is its performance better than MRI 1.8.7?
JRuby 1.5 states that it is 100% compatible with Ruby 1.8.7, does this mean that JRuby can run any Ruby/Rails code?
Yes, JRuby is reliable! Oracle uses JRuby for Oracle mix (http://mix.oracle.com/), Sun had used it for Kenai (http://kenai.com), and it's gonna be the next base for java.net (from kenai site: "Work is on-going for migrating the Java.net domain over to the Kenai infrastructure")!!
You can run almost every code, some gems uses native C extension and in JRuby there's a primitive support to it, but yes...rails just works.
You can deploy Rails apps in Application Servers like Tomcat or JBoss with Warbler that wraps Rails apps inside a .war file, it's pretty awesome!
update: you can see a lot of benchmarks here: http://programmingzen.com/2010/07/19/the-great-ruby-shootout-july-2010/
I am doing a lot of jruby work right now and can tell you that rails is certainly a viable option under the jruby interpreter. I've been pretty pleased and in my case have to use many native Java libraries, so jRuby is just such an awesome wrapper around that java code. I will say that I have had some technical challenges some that are worked out, some that are not yet.
unit testing: spooling up the jvm and then spooling up rails takes much longer, so your tests take longer to run - solution, potentially something like nailgun that keeps the jvm running
deployment: i have not gotten warbler to work for me, with my flavor of tomcat. this is a major issue for us.
pick your libraries, while some c extensions work, they are not all equally compatible.
if you are interested I would highly reccomend the jruby book, in beta, from Pragmantic Programmers at http://pragprog.com
JRuby rocks!! The simple reason being its portability features and integration with Java libraries. I personally use it with Netbeans and the fast debugger that comes with that seems very handly. Plus you do not want to see that native build errors and handling them. All these gems that you download for JRuby work 100% across any platform. With JRuby, you are simply bringing in the advantages of the Java's Platform independence.
Moreover, JRuby uses native threading which uses OS threads instead of Green threads as in CRuby (i think its not the case with the latest versions though)
In Gist, go JRuby!!
for windows I have found it to be much more stable than MRI when working with larger amounts of data. There are some bugs on windows still but they are actually work-around-able. Recommend.
Disclaimer: I don't use jruby in my day job - I merely experimented with running existing code using jruby.
It doesn't mean that it'll run all code successfully. For example, bioruby currently calls fork on jruby even though jruby doesn't really support it. (That's more of a bug in bioruby than a bug in jruby though)
I wouldn't call such behaviour "unreliable" though. It's fail-safe, like a plane that would not get off the ground, much less crash.

On Ubuntu does Shoes require Ruby1.8 or Ruby1.9?

I have only installed Ruby1.9 on my machine. Have some kind of problems with the programs I am trying to write using Shoes. Am wondering if this is a version issue.
I am trying to do some stuff over ssl.
Shoes comes with its own Ruby version embedded in the script you download. It is completely self-contained as far as I can tell.
I'm don't know what is "Shoes" but i found this:
https://launchpad.net/ubuntu/+source/shoes
according to that "shoes (0.r396-5)" Depend on "rubygems1.8"

Language in a Sandbox in Rails [duplicate]

This question already has answers here:
How to run untrusted Ruby code inside a safe sandbox?
(4 answers)
Closed 8 years ago.
I've found that there WAS a sandbox gem (created by the guys that made try ruby in your browser but it was compatible only with Ruby 1.8. Another problem is that I cannot find it anymore (it seems they stop serving the gem from the servers...).
So, is there any secure way of running ruby in a sandbox (so you can run it from your browser)?
Or an easy way to run (for example lua/python) in a sandbox (no filesystem access, no creation of objects etc) and be called from Ruby (Rails 2.2)?
I want to make an application like try_ruby even without having a ruby underneath. But it has to be an easy language (I saw there was a prolog in ruby, even a lisp but I don't think they are easy to learn languages...).
So, do you have any suggestions or tips? Or should I just start creating my own DSL in Ruby (if there is a solution in creating a somewhat safe system)?
Thx
I am developing an implementation of a sandbox for ruby based on a modification of the ruby interpreter written in C, I have released recently a functional version of the gem called shikashi (rdoc documentation).
You should try embedding JRuby in the browser.
http://ruby-in-browser.googlecode.com/svn/trunk/evalruby/index.html
The guy who wrote the original gem disappeared, Keyser Söze style:
http://www.rubyinside.com/why-the-lucky-stiff-is-missing-2278.html
I've read that the JRuby gem is more current or maintained, but I've found it buggy so far. Here are some setup instructions:
http://flouri.sh/2009/4/4/how-to-set-up-the-jruby-sandbox
Overall, it looks like Ruby is lacking a solid implementation of this right now :(
I came across This article on hackety.org(dead link) this morning. Maybe it can serve you as a guide into the right direction
Another way is like codepad.org does it (VM isolation and checking the calls)
I am not sure if you want to run any language in a sandbox. But I found that JavaScript has been running as a sandbox language for a long time. The ruby racer project lets you embed the v8 engine in ruby. Hope that helps.

Resources