Skip to content

Instantly share code, notes, and snippets.

require 'tempfile'
require 'java' if defined?(JRUBY_VERSION)
require 'test/unit'
require 'fileutils'
class TestTempfilesCleanUp < Test::Unit::TestCase
def setup
@tmpdir = "tmp_#{$$}"
Dir.mkdir @tmpdir rescue nil
diff --git a/argparser.cpp b/argparser.cpp
index cec153b..f703ce5 100644
--- a/argparser.cpp
+++ b/argparser.cpp
@@ -205,7 +205,7 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
#define CHECK_ARG \
it++; \
- if (it == args.end() || it->at(0) == '-') { \
+ if (it == args.end() || it->length() == 0 || it->at(0) == '-') { \
jruby -Ilib D:/work/jruby-dev/jruby/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec spec\java_integration
1)
'A Java primitive Array of type Class ref should be possible to create primitive array from Ruby array' FAILED
expected: class java.lang.String,
got: Java::JavaLang::String (using ==)
D:/work/jruby-dev/jruby/spec/java_integration/types/array_spec.rb:745
2)
'A Java primitive Array of type Class ref should be possible to create primitive array from Ruby array' FAILED
diff --git a/core/array/equal_value_spec.rb b/core/array/equal_value_spec.rb
index c579146..069d2ef 100644
--- a/core/array/equal_value_spec.rb
+++ b/core/array/equal_value_spec.rb
@@ -5,6 +5,13 @@ require File.dirname(__FILE__) + '/shared/eql'
describe "Array#==" do
it_behaves_like :array_eql, :==
+ it 'compares with an equivalent Array-like object using #to_ary' do
+ obj = mock('array-like')
# requiring rubygems is not needed for JRuby
require 'rubygems' unless defined?(JRUBY_VERSION)
require 'ffi'
# Simple FFI module for some low level system commands (on Windows only!):
# * Turn monitor(s) power off
# * Show the Start menu
module SysCommands
extend FFI::Library
# default RubySpec/CI settings for JRuby.
# detect windows platform:
require 'rbconfig'
require 'java'
require 'jruby'
IKVM = java.lang.System.get_property('java.vm.name') =~ /IKVM\.NET/
WINDOWS = Config::CONFIG['host_os'] =~ /mswin/
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x77227021, pid=6536, tid=3932
#
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing windows-x86 )
# Problematic frame:
# C [ntdll.dll+0x67021]
#
require 'ffi'
module MyFFI
FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000
extend FFI::Library
ffi_lib 'kernel32'
ffi_convention :stdcall
attach_function :FormatMessageA, [:int, :pointer, :int, :int, :string, :int, :pointer], :int
end
@vvs
vvs / test.rb
Created December 7, 2009 11:49
if RUBY_PLATFORM == 'java'
require 'jruby'
JRuby.runtime.instance_config.run_ruby_in_process = false
end
0.upto(4) do |n|
IO.popen("ruby -e 'exit(#{n})'") do |ioh|
ioh.each { |line| print line }
end
#>jruby -b -J-Djruby.debug.loadService.timing=true script\server
-> builtin/core_ext/symbol
<- builtin/core_ext/symbol - 35ms
-> enumerator
<- enumerator - 6ms
-> D:/work/jruby-dev/rails/xxx/config/boot
-> rubygems
-> rubygems/defaults
<- rubygems/defaults - 5ms
-> thread