Permalink
Browse files

Workaround Proc serialization for JRuby 1.7

  • Loading branch information...
1 parent d5bbd3c commit f28a75ec38cddf65e1a635c4a83c44d6e24cabdb @bbrowning bbrowning committed Sep 25, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/torquespec/daemon.rb
View
8 lib/torquespec/daemon.rb
@@ -1,6 +1,7 @@
require 'torquespec'
require 'rspec/core'
require 'drb'
+require 'jruby'
require 'torquebox-core'
module TorqueSpec
@@ -137,6 +138,13 @@ def marshal_load *args
end
end
+# Fix the same serialization of Proc objects as above, but for JRuby 1.7
+if JRUBY_VERSION > '1.6.8'
+ JRuby.reference(Proc).allocator = lambda { |runtime, klass|
+ Proc.new {}
+ }
+end
+
# We want exceptions tossed in the container to be passed back to the
# client, but there's no guarantee the type of Exception in the
# container will be available on the client's classpath, so we turn

0 comments on commit f28a75e

Please sign in to comment.