summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-14 22:13:35 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-01-14 22:13:35 +0000
commit726f929997736c0627cb53ac73342ec7ecb25c57 (patch)
tree4ec2f3bd6321d139f11ccd65cc0d7a2a8a615254 /dev-ruby/session/files
parentarm stable, bug #294958 (diff)
downloadgentoo-2-726f929997736c0627cb53ac73342ec7ecb25c57.tar.gz
gentoo-2-726f929997736c0627cb53ac73342ec7ecb25c57.tar.bz2
gentoo-2-726f929997736c0627cb53ac73342ec7ecb25c57.zip
Add a patch for JRuby compatibility by Charles Nutter (headius), and enable for JRuby target.
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/session/files')
-rw-r--r--dev-ruby/session/files/session-2.4.0-jruby.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/dev-ruby/session/files/session-2.4.0-jruby.patch b/dev-ruby/session/files/session-2.4.0-jruby.patch
new file mode 100644
index 000000000000..5827d4e1d08b
--- /dev/null
+++ b/dev-ruby/session/files/session-2.4.0-jruby.patch
@@ -0,0 +1,61 @@
+From 879f701c35699d194890c288a036b0037f6b3424 Mon Sep 17 00:00:00 2001
+From: Charles Oliver Nutter <headius@headius.com>
+Date: Thu, 14 Jan 2010 15:23:57 -0600
+Subject: [PATCH] Modifications to get session tests running green under JRuby.
+
+---
+ lib/session.rb | 16 +++++++++++-----
+ test/session.rb | 3 +++
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/lib/session.rb b/lib/session.rb
+index dffa1f3..824c76f 100755
+--- a/lib/session.rb
++++ b/lib/session.rb
+@@ -86,7 +86,9 @@ module Session
+ class << self
+ def default_prog
+ return @default_prog if defined? @default_prog and @default_prog
+- if defined? self::DEFAULT_PROG
++ # Workaround for http://jira.codehaus.org/browse/JRUBY-4479
++ if (self::DEFAULT_PROG rescue nil)
++# if defined? self::DEFAULT_PROG
+ return @default_prog = self::DEFAULT_PROG
+ else
+ @default_prog = ENV["SESSION_#{ self }_PROG"]
+@@ -150,10 +152,14 @@ module Session
+ @use_spawn = self.class::use_spawn unless self.class::use_spawn.nil?
+ @use_spawn = getopt('use_spawn', opts) if hasopt('use_spawn', opts)
+
+- @use_open3 = nil
+- @use_open3 = Session::use_open3 unless Session::use_open3.nil?
+- @use_open3 = self.class::use_open3 unless self.class::use_open3.nil?
+- @use_open3 = getopt('use_open3', opts) if hasopt('use_open3', opts)
++ if defined? JRUBY_VERSION
++ @use_open3 = true
++ else
++ @use_open3 = nil
++ @use_open3 = Session::use_open3 unless Session::use_open3.nil?
++ @use_open3 = self.class::use_open3 unless self.class::use_open3.nil?
++ @use_open3 = getopt('use_open3', opts) if hasopt('use_open3', opts)
++ end
+
+ @debug = nil
+ @debug = Session::debug unless Session::debug.nil?
+diff --git a/test/session.rb b/test/session.rb
+index 0b0f265..46fe19b 100644
+--- a/test/session.rb
++++ b/test/session.rb
+@@ -17,6 +17,9 @@ Session::debug = true
+ class TimeoutError < StandardError; end
+ def timeout n
+ #{{{
++ # JRuby does not support fork, so we stub out timeout here
++ return yield if defined? JRUBY_VERSION
++
+ ret = nil
+ cid = fork
+ unless cid
+--
+1.6.6
+