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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +4 -5
- data/README.md +7 -1
- data/VERSION.semver +1 -1
- data/aw.gemspec +3 -3
- data/checksum/aw-0.1.6.gem.sha512 +1 -0
- data/lib/aw.rb +2 -2
- data/lib/aw/fork.rb +13 -5
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e648d8460672829ad850bdf7c5708405d13e2e40e1f1556825a5c8fed799caa1
|
4
|
+
data.tar.gz: 99a834c8208aeddc4595dcb7cbd908b5ed8473b548aa0ec71b47a57e044ad135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b7d0812516d424f31a9c92312dac2623096aed9245903d91cfce2db6f5704b0cae323fdf75e48fee3cb58e2ec202ebf6aa73106df75e1fa6c976a24a7c4337c
|
7
|
+
data.tar.gz: 823fc827fe9d103b216c786180d7002e601da3ab17c863eadcdc813ef8992857a01f7c08d2002e257a707876ac16008c0c8fce233ef93890c8d0fa5965070a45
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
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://
|
103
|
+
[![Sashite](https://pbs.twimg.com/profile_images/618485028322975744/PZ9qPuI__400x400.png)](https://sashite.com/)
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
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', '~>
|
21
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
22
|
-
spec.add_development_dependency 'simplecov', '~> 0.
|
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
data/lib/aw/fork.rb
CHANGED
@@ -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
|
-
|
48
|
-
|
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.
|
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-
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
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.
|
131
|
+
rubygems_version: 3.0.3
|
131
132
|
signing_key:
|
132
133
|
specification_version: 4
|
133
134
|
summary: Aw, fork!
|