aw 0.1.6 → 0.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
  SHA256:
3
- metadata.gz: 396995473ce2e9b2705efebc0e732579c2016976f5ee29d64c3ae374a8388b3c
4
- data.tar.gz: f1216ba5cb65ba697c64a0cc186ae6a1dc2a9df5fb34d6efa2b2f321da01f29e
3
+ metadata.gz: e648d8460672829ad850bdf7c5708405d13e2e40e1f1556825a5c8fed799caa1
4
+ data.tar.gz: 99a834c8208aeddc4595dcb7cbd908b5ed8473b548aa0ec71b47a57e044ad135
5
5
  SHA512:
6
- metadata.gz: 331e42d1177b7550d73fdb665fa94fcda432513cc8fbf9484aa9909d1e21cbb3f874f4fc6135024760bb26b486d03d602dc4b02297b806c8e3ac8d3fa4275195
7
- data.tar.gz: 6e13bd1aaf2893b8807c1f5f2426e9a5ce0130f152cc90267b17a47e08d792c390fec6542eca214e09cf981294ba6ff9e63866981d08f1539c462d9e9bc1d5e7
6
+ metadata.gz: 0b7d0812516d424f31a9c92312dac2623096aed9245903d91cfce2db6f5704b0cae323fdf75e48fee3cb58e2ec202ebf6aa73106df75e1fa6c976a24a7c4337c
7
+ data.tar.gz: 823fc827fe9d103b216c786180d7002e601da3ab17c863eadcdc813ef8992857a01f7c08d2002e257a707876ac16008c0c8fce233ef93890c8d0fa5965070a45
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ .DS_Store
@@ -6,11 +6,10 @@ before_install:
6
6
  script:
7
7
  - bundle exec rake test
8
8
  rvm:
9
- - 2.2
10
- - 2.3
11
- - 2.4
12
- - 2.5
13
- - 2.6.1
9
+ - 2.3.8
10
+ - 2.4.5
11
+ - 2.5.3
12
+ - 2.6.3
14
13
  - ruby-head
15
14
  - jruby-head
16
15
  - rbx-3
data/README.md CHANGED
@@ -55,6 +55,12 @@ Aw.fork! { arr << 'FUU' } # => ["foo", "FUU"]
55
55
  arr # => ["foo"]
56
56
  ```
57
57
 
58
+ Exceptions raised within the block are propagated:
59
+
60
+ ```ruby
61
+ Aw.fork! { nil + 1 } # => NoMethodError (undefined method `+' for nil:NilClass)
62
+ ```
63
+
58
64
  ## Security
59
65
 
60
66
  As a basic form of security __Aw__ provides a set of SHA512 checksums for
@@ -94,4 +100,4 @@ See `LICENSE.md` file.
94
100
 
95
101
  This project is sponsored by:
96
102
 
97
- [![Sashite](https://sashite.com/img/sashite.png)](https://sashite.com/)
103
+ [![Sashite](https://pbs.twimg.com/profile_images/618485028322975744/PZ9qPuI__400x400.png)](https://sashite.com/)
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
data/aw.gemspec CHANGED
@@ -17,8 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ['lib']
18
18
 
19
19
  spec.add_development_dependency 'bundler', '~> 2.0'
20
- spec.add_development_dependency 'rake', '~> 12.3'
21
- spec.add_development_dependency 'rubocop', '~> 0.67'
22
- spec.add_development_dependency 'simplecov', '~> 0.16'
20
+ spec.add_development_dependency 'rake', '~> 13.0'
21
+ spec.add_development_dependency 'rubocop', '~> 0.75'
22
+ spec.add_development_dependency 'simplecov', '~> 0.17'
23
23
  spec.add_development_dependency 'yard', '~> 0.9'
24
24
  end
@@ -0,0 +1 @@
1
+ e419a0c5012219dc85b0b7c88ae7ac2c23a3b4b5fe25ca69b14299942a75cb0e3f593c4acb68ba3634c79f2ad7fc88bd6d151874ffcc8dad01c24c5d5bf5f12d
data/lib/aw.rb CHANGED
@@ -13,8 +13,8 @@ module Aw
13
13
  #
14
14
  # @return [#object_id] The result.
15
15
  def self.fork!(&block)
16
- Fork.new(*IO.pipe).call(&block)
16
+ Fork.new(*::IO.pipe).call(&block)
17
17
  end
18
18
  end
19
19
 
20
- require_relative File.join 'aw', 'fork'
20
+ require_relative File.join('aw', 'fork')
@@ -9,7 +9,7 @@ module Aw
9
9
  # @param write [IO] The write endpoint.
10
10
  def initialize(read, write)
11
11
  # Currently, not available on all platforms.
12
- raise 'fork() unimplemented' unless Process.respond_to?(:fork)
12
+ raise 'fork() unimplemented' unless ::Process.respond_to?(:fork)
13
13
 
14
14
  @read = read
15
15
  @write = write
@@ -32,10 +32,12 @@ module Aw
32
32
  pid = fork_and_return_pid(&block)
33
33
  write.close
34
34
  result = read.read
35
- Process.wait(pid)
35
+ ::Process.wait(pid)
36
36
 
37
37
  # rubocop:disable MarshalLoad
38
- Marshal.load(result)
38
+ ::Marshal.load(result).tap do |r|
39
+ raise r if r.is_a?(::Exception)
40
+ end
39
41
  # rubocop:enable MarshalLoad
40
42
  end
41
43
 
@@ -44,8 +46,14 @@ module Aw
44
46
  def fork_and_return_pid
45
47
  fork do
46
48
  read.close
47
- result = yield
48
- Marshal.dump(result, write)
49
+
50
+ begin
51
+ result = yield
52
+ rescue ::StandardError
53
+ result = $ERROR_INFO
54
+ end
55
+
56
+ ::Marshal.dump(result, write)
49
57
  exit!(0)
50
58
  end
51
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-12 00:00:00.000000000 Z
11
+ date: 2019-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.3'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12.3'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubocop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.67'
47
+ version: '0.75'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.67'
54
+ version: '0.75'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.16'
61
+ version: '0.17'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.16'
68
+ version: '0.17'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -105,6 +105,7 @@ files:
105
105
  - checksum/aw-0.1.3.gem.sha512
106
106
  - checksum/aw-0.1.4.gem.sha512
107
107
  - checksum/aw-0.1.5.gem.sha512
108
+ - checksum/aw-0.1.6.gem.sha512
108
109
  - lib/aw.rb
109
110
  - lib/aw/fork.rb
110
111
  - pkg_checksum
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubygems_version: 3.0.1
131
+ rubygems_version: 3.0.3
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: Aw, fork!