iso_latte 1.6 → 1.7

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: 74656872518b776b3d175d9ab8f327fa4da0fc23
4
- data.tar.gz: b8922365509c5bdbc7f1166948993006cb877817
3
+ metadata.gz: 153c27390df8ee2ee187e29750f5b551129b857a
4
+ data.tar.gz: d233c65eb3b63c02e757e14b0e1d2e362b1d2536
5
5
  SHA512:
6
- metadata.gz: e3e5a8635fd179976d36d9fbe9a03030a7a4a6703ade7f7028358da62423a97856ff1343ee60080b5da50b255829866ebf737a886ae7ae14ca897465ee45c3a7
7
- data.tar.gz: 25b9d79ccc52abb68f475f7ef332bfa73e1163bd3c814273f5d2efbcf85f545574d286715a36c000d7d815b2770c0b3ab950f05ef2fe5fc5bba70e219364a35f
6
+ metadata.gz: a39a189e992e379f1e131e1867768d4c0d1bede658c00329819be0d5ac8de3314e5758e1465824089de2186147c3b2809179eb981ffd9e88cd04abe588151887
7
+ data.tar.gz: 796bcf446ac579ede9bbe6a0aa163aee452b0929538fc79ce56dd5636a0bc176212f3714a31ca85523229a3b85c542dab5f1384a6ce4dee2e093b32d32200267
data/lib/iso_latte.rb CHANGED
@@ -46,8 +46,8 @@ module IsoLatte
46
46
  block.call
47
47
  end
48
48
  rescue StandardError => e
49
- mex = marshal(e)
50
- write_ex.write(mex)
49
+ marshal(e) # To check if it works before writing any of it to the stream
50
+ marshal(e, write_ex)
51
51
  write_ex.flush
52
52
  write_ex.close
53
53
  exit!(EXCEPTION_RAISED)
@@ -107,9 +107,9 @@ module IsoLatte
107
107
  # Save us from the race condition where it exited just as we decided to kill it.
108
108
  end
109
109
 
110
- def self.marshal(e)
110
+ def self.marshal(e, io = nil)
111
111
  begin
112
- return Marshal.dump(e)
112
+ return io ? Marshal.dump(e, io) : Marshal.dump(e)
113
113
  rescue NoMethodError
114
114
  rescue TypeError
115
115
  end
@@ -117,14 +117,14 @@ module IsoLatte
117
117
  begin
118
118
  e2 = e.class.new(e.message)
119
119
  e2.set_backtrace(e.backtrace)
120
- return Marshal.dump(e2)
120
+ return io ? Marshal.dump(e2, io) : Marshal.dump(e2)
121
121
  rescue NoMethodError
122
122
  rescue TypeError
123
123
  end
124
124
 
125
125
  e3 = IsoLatte::Error.new("Marshalling error with: #{e.message}")
126
126
  e3.set_backtrace(e.backtrace)
127
- Marshal.dump(e3)
127
+ io ? Marshal.dump(e3, io) : Marshal.dump(e3)
128
128
  end
129
129
 
130
130
  class Error < StandardError; end
@@ -1,3 +1,3 @@
1
1
  module IsoLatte
2
- VERSION = "1.6"
2
+ VERSION = "1.7"
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.6'
4
+ version: '1.7'
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-09-08 00:00:00.000000000 Z
12
+ date: 2015-09-11 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: