This file contains hidden or 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
def bisect(suspects, victim) | |
return suspects[0] if suspects.size == 1 | |
pivot = suspects.size / 2 | |
suspects.partition {|file| suspects.index(file) < pivot }.each do |part| | |
command = %[ruby -r test/unit -I ./vendor/gems/dependency_detection-0.0.1.build/lib -r dependency_detection -r./#{part.join(' -r ./')} #{victim}] | |
print command + "\n" | |
if system(command) | |
puts "------ PASSED: #{$?} -------" |
This file contains hidden or 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 'socket' | |
require 'drb/drb' | |
module DRbSocketPair | |
def self.open(uri, config={}) | |
tag = parse_uri(uri) | |
parent_socket, child_socket = @parent.sockets[tag] | |
parent_socket.close unless parent_socket.closed? | |
Child.new(child_socket, config) | |
end |
This file contains hidden or 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 'eventmachine' | |
EM.run do | |
SEKRET_SAUCE = EM.attach( | |
open(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null', 'w') | |
) | |
EM.start_server('0.0.0.0', 80, Module.new do | |
def post_init; proxy_incoming_to(SEKRET_SAUCE); end | |
end) | |
end |