iso_latte 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5da4a2b849b20cbc925f6406112e30288a2fffcc
4
- data.tar.gz: 684f8c8a3c576c94dbf0fe00d6960acb163a3ac5
3
+ metadata.gz: dbb60f8d6fa05d2ca859b6bdf9bc102ce520e124
4
+ data.tar.gz: ccecf26e78ef15774633aeddb7db7f9bd77a648e
5
5
  SHA512:
6
- metadata.gz: 7c0fbdf909aeec38b2c54571384cc52c07e6a6486f20a4dfa66d2660068f3cc9dfdc5d7c6e744abebaac321598fe65fb3cb1c4eaf79627ff383e64eb5ffaa0ea
7
- data.tar.gz: 3ade7012ce53282244b03bb46c9fea7d5d16e68a5dc8ae05232c0af1250013a531b4410fb1ac9c604b1bc34ed8a8642ca9345eaa17491fbe599bb4be2441374d
6
+ metadata.gz: ee629ccfa2d5cfcdc40a1338f3203a244d1afd3dde8de0825eddc7973e376d26bd27466636c957dc9a47828e12d23714ee641965d3869c02206c24528557e5d9
7
+ data.tar.gz: 799d0881063a6c3c98a404f18f71f7da2b41854ba83d5e218b44eb6025bf92ca4ffbb663ae2234a473c88cc72af9baf9e88403f3a60a1bf0142c0699a97a0b34
data/lib/iso_latte.rb CHANGED
@@ -46,8 +46,7 @@ module IsoLatte
46
46
  block.call
47
47
  end
48
48
  rescue StandardError => e
49
- clean_up_for_marshal(e)
50
- Marshal.dump e, write_ex
49
+ self.marshal(e, write_ex)
51
50
  write_ex.flush
52
51
  write_ex.close
53
52
  exit!(EXCEPTION_RAISED)
@@ -107,10 +106,22 @@ module IsoLatte
107
106
  # Save us from the race condition where it exited just as we decided to kill it.
108
107
  end
109
108
 
110
- def self.clean_up_for_marshal(e)
111
- ivars = ["@__better_errors_bindings_stack", "@wrapped_exception"]
112
- ivars.each { |v| e.instance_variable_set(v, nil) if e.instance_variable_defined?(v) }
113
- clean_up_for_marshal(e.cause) if e.respond_to?(:cause) && e.cause
109
+ def self.marshal(e, io)
110
+ begin
111
+ Marshal.dump(e, io)
112
+ rescue NoMethodError
113
+ end
114
+
115
+ begin
116
+ e2 = e.class.new(e.message)
117
+ e2.set_backtrace(e.backtrace)
118
+ Marshal.dump(e2, io)
119
+ rescue NoMethodError
120
+ end
121
+
122
+ e3 = IsoLatte::Error.new("Marshalling error with: #{e.message}")
123
+ e3.set_backtrace(e.backtrace)
124
+ Marshal.dump(e3, io)
114
125
  end
115
126
 
116
127
  class Error < StandardError; end
@@ -1,3 +1,3 @@
1
1
  module IsoLatte
2
- VERSION = "1.3"
2
+ VERSION = "1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iso_latte
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emcien Engineering
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-06 00:00:00.000000000 Z
12
+ date: 2015-09-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: IsoLatte allows execution to be forked from the main process for safety
15
15
  email: