iso_latte 1.1 → 1.2

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: 929b7df9ff0f59ee35cd1b20f0d861d37c8ebfef
4
- data.tar.gz: 6288dd0d0dae3ca40bd5c91387def5961c3e55af
3
+ metadata.gz: 30d8ef0d7afdd747760f17795fa0df8c2cfcf5ad
4
+ data.tar.gz: 431db2afed8cbe4c82bd353e064e389b5e0c8449
5
5
  SHA512:
6
- metadata.gz: bb1e74442a0cf7f03bcf239eb84d0d3b18863f466e14592e099c8f3c16990d8b4764de49d70b6572442c4a7b611a199594ab11ce60805e948bfa0990e85241ed
7
- data.tar.gz: 08c505d181c5945db613e60d1848d2988fbca6a9c7f888887b7fdbee0aa5af7c221845c57d98e67a7d8eea19e39f4fb911f6e2e829aba8a4b02c459c71127fe2
6
+ metadata.gz: 6b830352207630b5f1d1658f5e23c64162c044d16e07e13f2480ae3d245126ff387a320f7a7ddb4c7c9133ecf7ed7cf07688dd028e694720b4f567dd717e3a3d
7
+ data.tar.gz: 4ccace0f1cf37fba92a561d864833404f11a807099740ccd5eac8615b6b1f63fcc26f96800075009fc6a1199b13d063c9bf004b3f7875bc4ac557da3fe01581a
@@ -1,3 +1,3 @@
1
1
  module IsoLatte
2
- VERSION = "1.1"
2
+ VERSION = "1.2"
3
3
  end
data/lib/iso_latte.rb CHANGED
@@ -27,7 +27,7 @@ module IsoLatte
27
27
  # statuses I guess.
28
28
  #
29
29
  def self.fork(options = nil, &block)
30
- defaults = { stderr: "/dev/null", exit: nil }
30
+ defaults = { :stderr => "/dev/null", :exit => nil }
31
31
  opts = OpenStruct.new(defaults.merge(options || {}))
32
32
 
33
33
  read_ex, write_ex = IO.pipe
@@ -46,10 +46,7 @@ module IsoLatte
46
46
  block.call
47
47
  end
48
48
  rescue StandardError => e
49
- # Things that stick un-marshalable attributes on exceptions need to be handled here.
50
- ivars = ["@__better_errors_bindings_stack"]
51
- ivars.each { |v| e.instance_variable_set(v, nil) if e.instance_variable_defined?(v) }
52
-
49
+ clean_up_for_marshal(e)
53
50
  Marshal.dump e, write_ex
54
51
  write_ex.flush
55
52
  write_ex.close
@@ -110,5 +107,11 @@ module IsoLatte
110
107
  # Save us from the race condition where it exited just as we decided to kill it.
111
108
  end
112
109
 
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.cause
114
+ end
115
+
113
116
  class Error < StandardError; end
114
117
  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.1'
4
+ version: '1.2'
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-07-01 00:00:00.000000000 Z
12
+ date: 2015-08-06 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:
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  version: '0'
41
41
  requirements: []
42
42
  rubyforge_project:
43
- rubygems_version: 2.4.3
43
+ rubygems_version: 2.4.8
44
44
  signing_key:
45
45
  specification_version: 4
46
46
  summary: A gem for isolating execution in a subprocess