Skip to content

Instantly share code, notes, and snippets.

$ jgem sources -a http://gems.github.com
$ jgem install jabley-rubygems-isitjruby
Successfully installed json-jruby-1.1.7-universal-java-1.6
Successfully installed jabley-rubygems-isitjruby-1.1
2 gems installed
$ jgem install ZenTest
ZenTest 4.1.4 might work, 100% say 4.1.1 works on JRuby
Update http://isitjruby.com/ZenTest with your experiences!
class Foo
def self.logger
# create logger here
end
def logger
Foo.logger
end
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
common: &&common
adapter: <%= (defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby") ? "jdbc" : "" %>sqlite3
pool: 5
timeout: 5000
development:
<< : *common
database: db/development.sqlite3
$ cat svn2git.sh
#! /bin/sh
# Simple script to mirror an existing SVN repository as a git repository.
# Full project history will be imported
#
# Usage:
# svn2git.sh name-of-module
# name-of-module - the name of the GIT repository that we wish to create
# svn/module/path - the optional SVN path of the module being mirrored.
# Defaults to the name of the GIT repository being created
$ cat checkout-git-svn.sh
#!/bin/sh
# Simple script to checkout a project from git and tie up SVN commits. Should be a lot faster than git svn clone
# Initial parameter is the name of the git /svn module. Optional second parameter is the SVN path. This allows us to manage more complex SVN modules, which may be nested rather than at the top level
if [ -z $1 ] ; then
echo "Usage: $0 module-name [svn/path]"
exit 1
fi
$ rvm install jruby 1.4.0
basename: missing operand
Try `basename --help' for more information.
<i> Installing jruby-1.4.0RC1... </i>
<e> Error running 'cd /home/jabley/.rvm/src/jruby-1.4.0RC1/tool/nailgun && /usr/bin/make ', please check /home/jabley/.rvm/log/jruby-1.4.0RC1/nailgun.error.log </e>
<i> Installing JRuby to /home/jabley/.rvm/jruby-1.4.0RC1 </i>
<i> Installing jruby-openssl </i>
+__rvm_parse_args:295> [ '!' -z '' -o '!' -z '' ']'
+__rvm_parse_args:1> [ 3 -gt 0 ']'
+__rvm_parse_args:2> rvm_token=install
+__rvm_parse_args:2> shift
+__rvm_parse_args:3> case install (install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|update|readline|iconv|gemsync)
+__rvm_parse_args:5> rvm_action=install
+__rvm_parse_args:295> [ '!' -z '' -o '!' -z '' ']'
+__rvm_parse_args:1> [ 2 -gt 0 ']'
+__rvm_parse_args:2> rvm_token=jruby
+__rvm_parse_args:2> shift
$ cat test/test_enumerator.rb
def create_fib()
Enumerator.new { |y|
a = b = 1
loop {
y << a
a, b = b, a + b
}
}
@JRubyMethod(name = "initialize", visibility = Visibility.PUBLIC)
public IRubyObject initialize(ThreadContext context, Block block) {
if (!block.isGiven()) {
/* Probably should fail? Check RubySpecs */
}
return this;
}
From 0adaa2a3b4968cd7d0bafd9df1c5f948ac7ea79f Mon Sep 17 00:00:00 2001
From: James Abley <james.abley@gmail.com>
Date: Thu, 15 Oct 2009 21:58:56 +0100
Subject: [PATCH] Spec for non-ascii dynamic regexp with once modifier
See http://jira.codehaus.org/browse/JRUBY-4037
---
core/regexp/modifiers_spec.rb | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 core/regexp/modifiers_spec.rb