Skip to content

Instantly share code, notes, and snippets.

@mhenrixon
mhenrixon / exit_code_patch.rb
Created August 16, 2012 08:35
Monkey patch to make ruby exit codes work with continuous integration
# Monkey Patch ruby because of a bug introduced in ruby versions greater than 1.9.2
# For some reason the exit code is all wrong in later version of ruby and even though
# the issue was closed as sorted it's still broken in ruby version 1.9.3-p194.
# (see http://redmine.ruby-lang.org/issues/5218 for more information)
# Put this in spec_helper.rb or test_helper.rb so that it only affects specs and the CI server.
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" && RUBY_VERSION >= "1.9"
module Kernel
alias :__at_exit :at_exit
def at_exit(&block)
__at_exit do
@ngauthier
ngauthier / README.md
Last active December 8, 2023 13:56
install ruby 2.0.0-p0 on ubuntu