jruby

JRuby OpenSSL Error

女生的网名这么多〃 提交于 2019-12-03 15:11:29
I am having problems configuring JRuby to work properly with OpenSSL. Googling has revealed that this is a pretty common occurence, but none of the solutions I've read have worked for me. Here is my setup: Ubuntu 9.10 jruby 1.5.1 jruby-openssl (0.7) Here is the error: irb(main):001:0> require 'jruby/openssl/gem_only' => true irb(main):002:0> require 'openssl' => true irb(main):003:0> OpenSSL::Digest::OPENSSL_VERSION_NUMBER NameError: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER Interestingly, require 'openssl' returns true even if I don't have the jruby-openssl gem installed.

Ruby code to JAR

馋奶兔 提交于 2019-12-03 14:02:03
问题 I'd like to be able to compile a ruby program to a java JAR program. I've looked into JRuby and seen several examples of Java applications that would be able to eval() ruby code, but is there a more elegant solution allowing to simply code everything in ruby and then compile the lot directly to a JAR file? The overall goal behind that is to be able to extend a security tool called Burp Proxy. So I'd like to be able to use all my Ruby pentesting scripts (obviously organising them so they

SL4A vs Ruboto on Android Application Development

让人想犯罪 __ 提交于 2019-12-03 12:03:09
问题 I am thinking about creating apps on Android using JRuby (or a suitable variant of Ruby for Android). According to my research there are two current projects that support Ruby development on Android: Ruboto SL4A From the FAQ of the Ruboto wiki on github it seems like Ruboto is ready for application development, but does not yet support JIT compilation, and the application has to be packaged with libraries which give it a big footprint (for mobile device installation). I don't have enough

Faster RSpec with JRuby

▼魔方 西西 提交于 2019-12-03 10:19:58
I'm pretty new to the whole JRuby world. I'm using RSpec on a pretty big test suite. I'd like to be able to run the specs frequently but the JVM takes so long to startup it's becoming a real time drain. Is there a way to keep the JVM running? or a way to get specs to run faster with JRuby? Nick Sieger There are two things you could look into: Run a nailgun server and send spec runs to it. jruby --ng-server & and then jruby --ng -S spec or jruby --ng -S rake Use spork. http://www.ruby-forum.com/topic/190163 I hear that Roger Pack has a version that may work with JRuby. http://github.com/rdp

convert array of hashes to csv file

让人想犯罪 __ 提交于 2019-12-03 09:30:17
问题 How do you convert an array of hashes to a .csv file? I have tried CSV.open("data.csv", "wb") do |csv| @data.to_csv end but it is blank 回答1: Try this: CSV.open("data.csv", "wb") do |csv| @data.each do |hash| csv << hash.values end end If you want the first line of the CSV to contain the keys of the hash (kind of like a header), simply do: CSV.open("data.csv", "wb") do |csv| csv << @data.first.keys # adds the attributes name on the first line @data.each do |hash| csv << hash.values end end

Is there an advantage to running JRuby if you don't know any Java?

ⅰ亾dé卋堺 提交于 2019-12-03 08:30:05
问题 I've heard great things about JRuby and I know you can run it without knowing any Java. My development skills are strong, Java is just not one of the tools I know. It's a massive tool with a myriad of accompanying tools such as Maven/Ant/JUnit etc. Is it worth moving my current Rails applications to JRuby for performance reasons alone? Perhaps if I pick up some basic Java along side, there can be so added benefits that aren't obvious such as better debugging/performance optimization tools?

Find out which gems require native c extensions from a Gemfile?

别来无恙 提交于 2019-12-03 06:46:06
I just recently started shifting attention towards deploying Ruby apps atop TorqueBox which of course is built atop Jruby. Hitherto I have been basically performing a bundle install and then tackling each gem along the way to jrubydom, but I've hit a couple gems that have taken me some considerable time to resolve due to needing to reimplement large portions of them. Is there a way to invoke bundler or rubygems to run through all gems and their deps to test if they require native c extensions and then return such a list? It sure would be nice to tackle some of the more minor items or even to

How to setup neo4j with dBpedia ontop of ruby-on-rails application?

心已入冬 提交于 2019-12-03 06:21:40
I am trying to use dBpedia with neo4j ontop of ruby on rails . Assuming I have installed neo4j and downloaded one of the dBpedia datasets . How do I import the dbpedia dataset into neo4j ? espeed The simplest way to load dbpedia into Neo4j is to use the dbpedia4neo library. This is a Java library, but you don't need to know any Java because all you need to do is run the executable. You could rewrite this in JRuby if you want, but regular Ruby won't work because it relies on Blueprints , a Java library with no Ruby equivalent. Here are the two key files, which provide the loading procedure.

Why is a Regexp object considered to be “falsy” in Ruby?

孤街醉人 提交于 2019-12-03 05:28:57
Ruby has a universal idea of " truthiness " and " falsiness ". Ruby does have two specific classes for Boolean objects, TrueClass and FalseClass , with singleton instances denoted by the special variables true and false , respectively. However, truthiness and falsiness are not limited to instances of those two classes, the concept is universal and applies to every single object in Ruby. Every object is either truthy or falsy . The rules are very simple. In particular, only two objects are falsy : nil , the singleton instance of NilClass and false , the singleton instance of FalseClass Every

Security with Java Scripting (JRuby, Jython, Groovy, BeanShell, etc)

冷暖自知 提交于 2019-12-03 05:13:23
问题 I'm looking to run some un-verified scripts (written in a yet-to-be-determined language, but needs to be Java-based, so JRuby, Groovy, Jython, BeanShell, etc are all candidates). I want these scripts to be able to do some things and restricted from doing other things. Normally, I'd just go use Java's SecurityManager and be done with it. That's pretty simple and lets me restrict file and network access, the ability to shutdown the JVM, etc. And that will work well for the high level stuff I