This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "benchmark" | |
require_relative "stacksize" | |
class EnumBlkCall | |
def initialize(num) | |
@num = num | |
end | |
def each(&blk) | |
i = 0 | |
while i < @num |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test/openssl/test_engine.rb b/test/openssl/test_engine.rb | |
index fce5f76..db80521 100644 | |
--- a/test/openssl/test_engine.rb | |
+++ b/test/openssl/test_engine.rb | |
@@ -41,6 +41,10 @@ class OpenSSL::TestEngine < Test::Unit::TestCase | |
end | |
def test_openssl_engine_cipher_rc4 | |
+ # suppress message from OpenSSL | |
+ tmpfile = Tempfile.new("openssl_cipher_rc4") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "coreaudio" | |
# Usage: record_soundflower.rb output.m4a | |
def silent?(wav) | |
wav.max == 0 and wav.min == 0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GNU/Linux 2.6.9-89.ELsmp Intel Xeon CPU 3.80GHz | |
OLD = ruby 2.0.0dev (2011-12-26 trunk 34132) [x86_64-linux] | |
NEW = ruby 2.0.0dev (2011-12-26 trunk 34138) [x86_64-linux] | |
name OLD NEW diff (diff %) | |
vm3_gc 4.86306 2.51985 -2.34321 (-48.184%) | |
vm_thread_pass_flood 0.95898 0.69652 -0.26246 (-27.369%) | |
app_mandelbrot 5.21070 4.14362 -1.06709 (-20.479%) | |
so_random 2.61012 2.13744 -0.47268 (-18.109%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GNU/Linux 2.6.9-89.ELsmp Intel Xeon CPU 3.80GHz | |
OLD = ruby 2.0.0dev (2011-12-26 trunk 34132) [x86_64-linux] | |
NEW = ruby 2.0.0dev (2011-12-26 trunk 34134) [x86_64-linux] | |
OLD NEW diff (diff %) | |
vm3_gc 4.99243 2.60234 -2.39009 (-47.874%) | |
app_mandelbrot 5.28168 4.16063 -1.12105 (-21.225%) | |
so_mandelbrot 16.82127 13.69298 -3.12829 (-18.597%) | |
so_partial_sums 16.27839 13.77973 -2.49866 (-15.350%) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/test/unit.rb b/lib/test/unit.rb | |
index eb0666a..00313a3 100644 | |
--- a/lib/test/unit.rb | |
+++ b/lib/test/unit.rb | |
@@ -457,7 +457,9 @@ module Test | |
bang = $1 | |
worker.status = :ready | |
if @tasks.empty? | |
- break unless @workers.find{|x| x.status == :running } | |
+ unless @workers.find{|x| [:running, :prepare].include? x.status} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb | |
index 76eb82c..0fbec35 100644 | |
--- a/test/ruby/test_io.rb | |
+++ b/test/ruby/test_io.rb | |
@@ -1409,13 +1409,15 @@ class TestIO < Test::Unit::TestCase | |
end | |
def try_fdopen(fd, autoclose = true, level = 100) | |
- if level > 0 | |
- try_fdopen(fd, autoclose, level - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `publish' all private instance methods | |
ObjectSpace.each_object(Module) do |mod| | |
mod.private_instance_methods(false).each do |meth| | |
mod.__send__(:public, meth) | |
end | |
end | |
# define accessor methods as ghost method | |
class Object | |
def method_missing(meth, *args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Cap { Black, White } | |
abstract sig Children { | |
cap: one Cap, | |
visible: set Children | |
} | |
one sig A extends Children {} { | |
visible = none | |
cap = Black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ary = (0..10).to_a | |
o = Object.new | |
o.instance_variable_set(:@ary, ary) | |
def o.to_ary | |
@ary | |
end | |
l = [o].lazy.flat_map{|x| x} | |
p l.next # => 0 | |
ary.clear |