View test_redirected_io_to_custom_class.rb
1 2 3 4 5 6 7 8 9 10
require 'logger'
 
class StandardOutput < IO
def initialize(logger)
@logger = logger
end
 
def write(message)
@logger.info("INTERCEPTED: #{message}")
end
View test_non_ascii_filename_mkpath.rb
1 2 3 4 5 6 7 8 9 10
#encoding: UTF-8
 
require 'pathname'
 
path = '/tmp/INSERT_NON_ASCII_NAME' # just type in any non-ascii characters
pathname = Pathname.new(path)
 
begin
puts 'MKPATH'
# fails with IllegalArgumentException
View halfsync_halfasync.rb
1 2 3 4 5 6 7 8 9
require "singleton"
require "socket"
 
ACCEPT_EVENT = 0x01
RECEIVE_EVENT = 0x02
WRITE_EVENT = 0x04
# Y_EVENT = 0x08
# Z_EVENT = 0x10
# Etc.
View super_bench.rb
1 2 3 4 5 6 7 8 9 10
# Test the performance of testing for equality in a class that includes
# a module and calls super on it. See if there is any difference between
# arg == Const and Const == arg for the runtimes.
#
 
require 'rubygems'
require 'benchmark'
 
A = 1
B = 2
View gist:e87a4723d643cfd38769
1 2 3 4 5 6 7 8 9 10
diff --git a/core/src/main/java/org/jruby/RubyThread.java b/core/src/main/java/org/jruby/RubyThread.java
index cf325de..cbc0c82 100644
--- a/core/src/main/java/org/jruby/RubyThread.java
+++ b/core/src/main/java/org/jruby/RubyThread.java
@@ -55,6 +55,7 @@ import org.jruby.internal.runtime.NativeThread;
import org.jruby.internal.runtime.RubyRunnable;
import org.jruby.internal.runtime.ThreadLike;
import org.jruby.internal.runtime.ThreadService;
+import org.jruby.javasupport.JavaUtil;
import org.jruby.runtime.Block;
View gist:84731230ede769fdce5d
1 2 3 4 5 6 7 8 9 10
diff -ru ../ruby/test/lib/leakchecker.rb test/mri/lib/leakchecker.rb
--- ../ruby/test/lib/leakchecker.rb 2014-11-04 23:26:38.000000000 -0600
+++ test/mri/lib/leakchecker.rb 2014-11-08 11:46:12.000000000 -0600
@@ -66,7 +66,6 @@
end
puts "Leaked file descriptor: #{test_name}: #{fd}#{str}"
}
- #system("lsof -p #$$") if !fd_leaked.empty?
h.each {|fd, list|
next if list.length <= 1
View changelog output
1 2 3 4
~/projects/ruby $ changelog
Fri Oct 31 15:56:46 2014 Charles Oliver Nutter <headius@headius.com>
 
* object.c: Make a meaningless change to test changelog script.
View gist:cef36c9cb9f51de588eb
1 2 3 4 5 6 7 8 9 10
JRuby zlib
 
user system total real
write 0.054059 0.007411 0.061470 ( 0.047307)
read 0.019310 0.002438 0.021748 ( 0.011610)
 
JRuby pr-zlib
 
user system total real
write 9.660000 0.070000 9.730000 ( 8.077000)
View 1.blah.rb
1 2 3 4 5 6 7 8 9 10
def start_thread
1.times {
begin
p
rescue
p
ensure
p
end
}
View gist:98fdf1f7e8a6c3b037b9
1 2 3 4 5 6 7 8 9 10
diff --git a/core/src/main/java/org/jruby/RubyEncoding.java b/core/src/main/java/org/jruby/RubyEncoding.java
index f872076..5e2c025 100755
--- a/core/src/main/java/org/jruby/RubyEncoding.java
+++ b/core/src/main/java/org/jruby/RubyEncoding.java
@@ -81,7 +81,7 @@ public class RubyEncoding extends RubyObject implements Constantizable {
private final Object constant;
private RubyEncoding(Ruby runtime, byte[] name, int p, int end, boolean isDummy) {
- this(runtime, new ByteList(name, p, end), null, false);
+ this(runtime, new ByteList(name, p, end), null, isDummy);
Something went wrong with that request. Please try again.