Skip to content

Instantly share code, notes, and snippets.

View arielvalentin's full-sized avatar

Ariel Valentin arielvalentin

View GitHub Profile
@arielvalentin
arielvalentin / jruby_timeout.rb
Last active December 23, 2015 09:29 — forked from jorgenpt/jruby_timeout.rb
Don't use this
# Workaround for IO.popen.readlines being allowed to block indefinitely even if
# wrapped in a Timeout::timeout call.
#
# Test case:
# $ time jruby -rtimeout -e "timeout(1) { IO.popen('sleep 10').readlines }"
# * Propagating errors executed in the block
# * Thread.raise experiences a TypeError because it cannot convert a java Exception into a ruby Error so I've added handling any errors raised from the java code to be propagated correctly
# * Renamed some variables so that they matched
require 'timeout'
@arielvalentin
arielvalentin / Gemfile
Last active January 3, 2016 23:19 — forked from mkristian/Gemfile
source 'https://rubygems.org'
# Specify your gem's dependencies in vtd-xml.gemspec
gemspec
# needed to build the gem but fails when it is part of the gems
gem "ruby-maven", '~> 3.1.1.0'