aw 0.1.9 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +28 -55
- data/lib/aw.rb +12 -8
- data/lib/aw/fork.rb +22 -11
- metadata +70 -48
- data/.gitignore +0 -12
- data/.travis.yml +0 -27
- data/.yardopts +0 -1
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -5
- data/Rakefile +0 -22
- data/VERSION.semver +0 -1
- data/aw.gemspec +0 -24
- data/bin/console +0 -8
- data/bin/setup +0 -6
- data/checksum/aw-0.1.0.gem.sha512 +0 -1
- data/checksum/aw-0.1.1.gem.sha512 +0 -1
- data/checksum/aw-0.1.2.gem.sha512 +0 -1
- data/checksum/aw-0.1.3.gem.sha512 +0 -1
- data/checksum/aw-0.1.4.gem.sha512 +0 -1
- data/checksum/aw-0.1.5.gem.sha512 +0 -1
- data/checksum/aw-0.1.6.gem.sha512 +0 -1
- data/checksum/aw-0.1.8.gem.sha512 +0 -1
- data/pkg_checksum +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9af984fb0d47a9566b6ca5c9ac4a7208328cb444b504865e4fff631bb4122db7
|
4
|
+
data.tar.gz: 8c9759ef06861c6518cedd5867d85ebb04b62a01512a42abd94b401a3d67aa92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b950326ea7dc9a6846f079e75325e14d90d0261466dbd896dc57644eba8ef08ef8935364e756b6e41ed9f8b11cef68bb9752c9d3ad146daaf375f0b5334920d3
|
7
|
+
data.tar.gz: f21141ba62144f1b86ebead8c2816625c243272c51e671fcbdf95a28b8f81c8716dae4e7063427722094db3e661e8ceca2fdf757f2bf26612f9673dc35754b26
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -1,103 +1,76 @@
|
|
1
1
|
# Aw
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![
|
3
|
+
[![Version](https://img.shields.io/github/v/tag/fixrb/aw?label=Version&logo=github)](https://github.com/fixrb/aw/releases)
|
4
|
+
[![Yard documentation](https://img.shields.io/badge/Yard-documentation-blue.svg?logo=github)](https://rubydoc.info/github/fixrb/aw/main)
|
5
|
+
[![CI](https://github.com/fixrb/aw/workflows/CI/badge.svg?branch=main)](https://github.com/fixrb/aw/actions?query=workflow%3Aci+branch%3Amain)
|
6
|
+
[![RuboCop](https://github.com/fixrb/aw/workflows/RuboCop/badge.svg?branch=main)](https://github.com/fixrb/aw/actions?query=workflow%3Arubocop+branch%3Amain)
|
7
|
+
[![License](https://img.shields.io/github/license/fixrb/aw?label=License&logo=github)](https://github.com/fixrb/aw/raw/main/LICENSE.md)
|
8
8
|
|
9
|
-
> Aw, fork!
|
9
|
+
> Aw, fork! 😬
|
10
10
|
|
11
|
-
Creates a
|
12
|
-
|
13
|
-
## Contact
|
14
|
-
|
15
|
-
* Home page: https://github.com/fixrb/aw
|
16
|
-
* Bugs/issues: https://github.com/fixrb/aw/issues
|
17
|
-
* Support: https://stackoverflow.com/questions/tagged/fixrb
|
18
|
-
|
19
|
-
## Rubies
|
20
|
-
|
21
|
-
* [MRI](https://www.ruby-lang.org/)
|
22
|
-
* [Rubinius](https://rubinius.com/)
|
11
|
+
Creates a sub-process to execute a block inside, and return the result.
|
23
12
|
|
24
13
|
## Installation
|
25
14
|
|
26
15
|
Add this line to your application's Gemfile:
|
27
16
|
|
28
17
|
```ruby
|
29
|
-
gem
|
18
|
+
gem "aw"
|
30
19
|
```
|
31
20
|
|
32
21
|
And then execute:
|
33
22
|
|
34
|
-
|
23
|
+
```sh
|
24
|
+
bundle
|
25
|
+
```
|
35
26
|
|
36
27
|
Or install it yourself as:
|
37
28
|
|
38
|
-
|
29
|
+
```sh
|
30
|
+
gem install aw
|
31
|
+
```
|
39
32
|
|
40
33
|
## Usage
|
41
34
|
|
42
|
-
|
35
|
+
Execute a block of code in a sub-process, and return the result to the current process:
|
43
36
|
|
44
37
|
```ruby
|
45
38
|
Aw.fork! { 6 * 7 } # => 42
|
46
39
|
```
|
47
40
|
|
48
|
-
|
41
|
+
Therefore, when the execution of a block of code causes side effects, they are limited to the sub-process:
|
49
42
|
|
50
43
|
```ruby
|
51
|
-
arr = [
|
44
|
+
arr = ["foo"]
|
52
45
|
|
53
|
-
Aw.fork! { arr <<
|
46
|
+
Aw.fork! { arr << "FUU" } # => ["foo", "FUU"]
|
54
47
|
|
55
48
|
arr # => ["foo"]
|
56
49
|
```
|
57
50
|
|
58
|
-
Exceptions raised within
|
51
|
+
Exceptions raised within a block of code are propagated:
|
59
52
|
|
60
53
|
```ruby
|
61
54
|
Aw.fork! { nil + 1 } # => NoMethodError (undefined method `+' for nil:NilClass)
|
62
55
|
```
|
63
56
|
|
64
|
-
##
|
65
|
-
|
66
|
-
As a basic form of security __Aw__ provides a set of SHA512 checksums for
|
67
|
-
every Gem release. These checksums can be found in the `checksum/` directory.
|
68
|
-
Although these checksums do not prevent malicious users from tampering with a
|
69
|
-
built Gem they can be used for basic integrity verification purposes.
|
70
|
-
|
71
|
-
The checksum of a file can be checked using the `sha512sum` command. For
|
72
|
-
example:
|
57
|
+
## Contact
|
73
58
|
|
74
|
-
|
75
|
-
548d9f669ded4e622182791a5390aaceae0bf2e557b0864f05a842b0be2c65e10e1fb8499f49a3b9efd0e8eaeb691351b1c670d6316ce49965a99683b1071389 pkg/aw-0.1.0.gem
|
59
|
+
* Source code: https://github.com/fixrb/aw
|
76
60
|
|
77
61
|
## Versioning
|
78
62
|
|
79
63
|
__Aw__ follows [Semantic Versioning 2.0](https://semver.org/).
|
80
64
|
|
81
|
-
## Contributing
|
82
|
-
|
83
|
-
1. [Fork it](https://github.com/fixrb/aw/fork)
|
84
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
85
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
86
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
87
|
-
5. Create a new Pull Request
|
88
|
-
|
89
65
|
## License
|
90
66
|
|
91
|
-
|
92
|
-
|
93
|
-
[gem]: https://rubygems.org/gems/aw
|
94
|
-
[travis]: https://travis-ci.org/fixrb/aw
|
95
|
-
[codeclimate]: https://codeclimate.com/github/fixrb/aw
|
96
|
-
[inchpages]: http://inch-ci.org/github/fixrb/aw
|
97
|
-
[rubydoc]: http://rubydoc.info/gems/aw/frames
|
67
|
+
The [gem](https://rubygems.org/gems/aw) is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
98
68
|
|
99
69
|
***
|
100
70
|
|
101
|
-
|
102
|
-
|
103
|
-
|
71
|
+
<p>
|
72
|
+
This project is sponsored by:<br />
|
73
|
+
<a href="https://sashite.com/"><img
|
74
|
+
src="https://github.com/fixrb/aw/raw/main/img/sashite.png"
|
75
|
+
alt="Sashite" /></a>
|
76
|
+
</p>
|
data/lib/aw.rb
CHANGED
@@ -2,19 +2,23 @@
|
|
2
2
|
|
3
3
|
# Namespace for the Aw library.
|
4
4
|
#
|
5
|
-
# @
|
6
|
-
#
|
7
|
-
# @example Fork and return 42 from 6 * 7.
|
5
|
+
# @example Computes `6 * 7` in a sub-process and returns `42` to the current process.
|
8
6
|
# Aw.fork! { 6 * 7 } # => 42
|
7
|
+
#
|
8
|
+
# @api public
|
9
9
|
module Aw
|
10
|
-
#
|
10
|
+
# Runs the block inside a sub-process, and returns the computed value.
|
11
|
+
#
|
12
|
+
# @param block [Proc] The code to run in a sub-process.
|
11
13
|
#
|
12
|
-
# @
|
14
|
+
# @example Computes `6 * 7` in a sub-process and returns `42` to the current process.
|
15
|
+
# fork! { 6 * 7 } # => 42
|
13
16
|
#
|
14
|
-
# @return [#object_id] The
|
17
|
+
# @return [#object_id] The computed value.
|
15
18
|
def self.fork!(&block)
|
16
|
-
|
19
|
+
read, write = ::IO.pipe
|
20
|
+
Fork.new(read, write).call(&block)
|
17
21
|
end
|
18
22
|
end
|
19
23
|
|
20
|
-
require_relative File.join(
|
24
|
+
require_relative File.join("aw", "fork")
|
data/lib/aw/fork.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "English"
|
4
4
|
|
5
5
|
module Aw
|
6
6
|
# The Fork class.
|
7
|
+
#
|
8
|
+
# @api private
|
7
9
|
class Fork
|
8
10
|
# Initialize the class.
|
9
11
|
#
|
@@ -11,7 +13,7 @@ module Aw
|
|
11
13
|
# @param write [IO] The write endpoint.
|
12
14
|
def initialize(read, write)
|
13
15
|
# Currently, not available on all platforms.
|
14
|
-
raise
|
16
|
+
raise ::NotImplementedError, "fork()" unless ::Process.respond_to?(:fork)
|
15
17
|
|
16
18
|
@read = read
|
17
19
|
@write = write
|
@@ -27,26 +29,33 @@ module Aw
|
|
27
29
|
# @return [IO] The write endpoint.
|
28
30
|
attr_reader :write
|
29
31
|
|
30
|
-
#
|
32
|
+
# Runs the block inside a sub-process, and returns the computed value.
|
31
33
|
#
|
32
|
-
# @
|
33
|
-
|
34
|
+
# @example Computes `6 * 7` in a sub-process and returns `42` to the current process.
|
35
|
+
# call { 6 * 7 } # => 42
|
36
|
+
#
|
37
|
+
# @return [#object_id] The computed value.
|
38
|
+
def call(&block)
|
34
39
|
pid = fork_and_return_pid(&block)
|
35
40
|
write.close
|
36
41
|
result = read.read
|
37
42
|
::Process.wait(pid)
|
38
43
|
|
39
|
-
# rubocop:disable MarshalLoad
|
40
|
-
::Marshal.load(result).tap
|
41
|
-
|
42
|
-
end
|
43
|
-
# rubocop:enable MarshalLoad
|
44
|
+
# rubocop:disable Security/MarshalLoad
|
45
|
+
::Marshal.load(result).tap { |r| raise r if r.is_a?(::Exception) }
|
46
|
+
# rubocop:enable Security/MarshalLoad
|
44
47
|
end
|
45
48
|
|
46
49
|
private
|
47
50
|
|
51
|
+
# Creates a sub-process to execute a block inside, and returns the
|
52
|
+
# sub-process ID.
|
53
|
+
#
|
54
|
+
# @return [Integer] The ID of the created sub-process.
|
48
55
|
def fork_and_return_pid
|
49
56
|
fork do
|
57
|
+
# :nocov:
|
58
|
+
|
50
59
|
read.close
|
51
60
|
|
52
61
|
# rubocop:disable Lint/RescueException
|
@@ -58,7 +67,9 @@ module Aw
|
|
58
67
|
# rubocop:enable Lint/RescueException
|
59
68
|
|
60
69
|
::Marshal.dump(result, write)
|
61
|
-
exit!(
|
70
|
+
exit!(true)
|
71
|
+
|
72
|
+
# :nocov:
|
62
73
|
end
|
63
74
|
end
|
64
75
|
end
|
metadata
CHANGED
@@ -1,115 +1,137 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '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: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
42
|
+
name: rubocop-md
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
47
|
+
version: '0'
|
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'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-performance
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-thread_safety
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: simplecov
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
|
-
- - "
|
101
|
+
- - ">="
|
60
102
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
103
|
+
version: '0'
|
62
104
|
type: :development
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
|
-
- - "
|
108
|
+
- - ">="
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
110
|
+
version: '0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: yard
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
|
-
- - "
|
115
|
+
- - ">="
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
117
|
+
version: '0'
|
76
118
|
type: :development
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
|
-
- - "
|
122
|
+
- - ">="
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
83
|
-
description: Creates a
|
84
|
-
email:
|
85
|
-
- contact@cyril.email
|
124
|
+
version: '0'
|
125
|
+
description: Creates a sub-process to execute a block inside, and returns the result.
|
126
|
+
email: contact@cyril.email
|
86
127
|
executables: []
|
87
128
|
extensions: []
|
88
129
|
extra_rdoc_files: []
|
89
130
|
files:
|
90
|
-
- ".gitignore"
|
91
|
-
- ".travis.yml"
|
92
|
-
- ".yardopts"
|
93
|
-
- CODE_OF_CONDUCT.md
|
94
|
-
- Gemfile
|
95
131
|
- LICENSE.md
|
96
132
|
- README.md
|
97
|
-
- Rakefile
|
98
|
-
- VERSION.semver
|
99
|
-
- aw.gemspec
|
100
|
-
- bin/console
|
101
|
-
- bin/setup
|
102
|
-
- checksum/aw-0.1.0.gem.sha512
|
103
|
-
- checksum/aw-0.1.1.gem.sha512
|
104
|
-
- checksum/aw-0.1.2.gem.sha512
|
105
|
-
- checksum/aw-0.1.3.gem.sha512
|
106
|
-
- checksum/aw-0.1.4.gem.sha512
|
107
|
-
- checksum/aw-0.1.5.gem.sha512
|
108
|
-
- checksum/aw-0.1.6.gem.sha512
|
109
|
-
- checksum/aw-0.1.8.gem.sha512
|
110
133
|
- lib/aw.rb
|
111
134
|
- lib/aw/fork.rb
|
112
|
-
- pkg_checksum
|
113
135
|
homepage: https://github.com/fixrb/aw
|
114
136
|
licenses:
|
115
137
|
- MIT
|
@@ -122,15 +144,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
144
|
requirements:
|
123
145
|
- - ">="
|
124
146
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
147
|
+
version: 2.7.0
|
126
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
149
|
requirements:
|
128
150
|
- - ">="
|
129
151
|
- !ruby/object:Gem::Version
|
130
152
|
version: '0'
|
131
153
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
154
|
+
rubygems_version: 3.1.6
|
133
155
|
signing_key:
|
134
156
|
specification_version: 4
|
135
|
-
summary: Aw, fork!
|
157
|
+
summary: "Aw, fork! \U0001F62C"
|
136
158
|
test_files: []
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
cache: bundler
|
4
|
-
before_install:
|
5
|
-
- gem install bundler
|
6
|
-
script:
|
7
|
-
- bundle exec rake test
|
8
|
-
rvm:
|
9
|
-
- 2.3.8
|
10
|
-
- 2.4.5
|
11
|
-
- 2.5.3
|
12
|
-
- 2.6.3
|
13
|
-
- ruby-head
|
14
|
-
- jruby-head
|
15
|
-
- rbx-3
|
16
|
-
matrix:
|
17
|
-
allow_failures:
|
18
|
-
- rvm: ruby-head
|
19
|
-
- rvm: jruby-head
|
20
|
-
- rvm: rbx-3
|
21
|
-
notifications:
|
22
|
-
webhooks:
|
23
|
-
urls:
|
24
|
-
- https://webhooks.gitter.im/e/a44b19cc5cf6db25fa87
|
25
|
-
on_success: change
|
26
|
-
on_failure: always
|
27
|
-
on_start: never
|
data/.yardopts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
- README.md
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
-
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
-
|
7
|
-
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
-
|
9
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
-
|
11
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
-
|
13
|
-
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
require 'rake/testtask'
|
5
|
-
require 'rubocop/rake_task'
|
6
|
-
|
7
|
-
RuboCop::RakeTask.new
|
8
|
-
|
9
|
-
Rake::TestTask.new do |t|
|
10
|
-
t.verbose = true
|
11
|
-
t.warning = true
|
12
|
-
end
|
13
|
-
|
14
|
-
namespace :test do
|
15
|
-
task :coverage do
|
16
|
-
ENV['COVERAGE'] = 'true'
|
17
|
-
Rake::Task['test'].invoke
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
task(:doc_stats) { ruby '-S yard stats' }
|
22
|
-
task default: %i[test doc_stats rubocop]
|
data/VERSION.semver
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.9
|
data/aw.gemspec
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'aw'
|
5
|
-
spec.version = File.read('VERSION.semver').chomp
|
6
|
-
spec.authors = ['Cyril Kato']
|
7
|
-
spec.email = ['contact@cyril.email']
|
8
|
-
|
9
|
-
spec.summary = 'Aw, fork!'
|
10
|
-
spec.description = 'Creates a subprocess to execute a block inside.'
|
11
|
-
spec.homepage = 'https://github.com/fixrb/aw'
|
12
|
-
spec.license = 'MIT'
|
13
|
-
|
14
|
-
spec.files =
|
15
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
|
16
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
-
spec.require_paths = ['lib']
|
18
|
-
|
19
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
20
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
21
|
-
spec.add_development_dependency 'rubocop', '~> 0.76'
|
22
|
-
spec.add_development_dependency 'simplecov', '~> 0.17'
|
23
|
-
spec.add_development_dependency 'yard', '~> 0.9'
|
24
|
-
end
|
data/bin/console
DELETED
data/bin/setup
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
d346779ca7a2cba2429db9e6342f8caebd12ccc3a647d75ad6eac28836bb683330ecdc0b74b81d95d55f8d2954ad5d5bd5f933b022c89b0b7e0f92cf2565d525
|
@@ -1 +0,0 @@
|
|
1
|
-
8e091e9aa3602e755d40656672571a61607e02a5fa8cdf97b10495539b6fbef17f855e515d1bfa21a9713a6e80eec9b1d05f2808ba11273bc49914ebab03fd0e
|
@@ -1 +0,0 @@
|
|
1
|
-
7a43c3de3e6980c036ff0079ea9337e7d8f90776a25449b8d316f6ee197deca53197068cf84e5d0acad3b06e338e46c11708616fb8d1cd1bea8dba06dbfb006e
|
@@ -1 +0,0 @@
|
|
1
|
-
294ce3632dde78870391b104bfbf52e60c95f95d897bb35a1085aa0d6ca5d335db360fdb231c7901a5f3a4e552888929a7f4b8472cf5f0d9c2f0e86f0a50389c
|
@@ -1 +0,0 @@
|
|
1
|
-
45e77c7139991cb235955cd2815afbab237a73208cf066446e09f182af401d6b9c3770034c05bdf9caded95351c0508f869b0ff2496681c914f9f80d167d838f
|
@@ -1 +0,0 @@
|
|
1
|
-
ab4cd0b855ea49e690d67b742793dee8d31682cd0aa570bc0a15651217d87b32e7dc5a41cab7dddf56d492afe5f7ea85e5cd1982361b77686ece29abdd770df0
|
@@ -1 +0,0 @@
|
|
1
|
-
e419a0c5012219dc85b0b7c88ae7ac2c23a3b4b5fe25ca69b14299942a75cb0e3f593c4acb68ba3634c79f2ad7fc88bd6d151874ffcc8dad01c24c5d5bf5f12d
|
@@ -1 +0,0 @@
|
|
1
|
-
90f7d2deceebc7a0f82156bc733b6997ba3714bba3fca2cb9a10935bf7937b5747b63b2f044a6cef3de5f7bb47250918cab0e294d2eea3073248cf76dd01aec7
|
data/pkg_checksum
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require 'digest/sha2'
|
5
|
-
|
6
|
-
gemname = :aw
|
7
|
-
ARGV[0] = File.read('VERSION.semver').chomp if ARGV[0].nil?
|
8
|
-
built_gem_path = "pkg/#{gemname}-#{ARGV[0]}.gem"
|
9
|
-
checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
|
10
|
-
checksum_path = "checksum/#{gemname}-#{ARGV[0]}.gem.sha512"
|
11
|
-
|
12
|
-
File.open(checksum_path, 'w') { |f| f.write("#{checksum}\n") }
|