aw 0.1.7 → 0.1.12

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: e648d8460672829ad850bdf7c5708405d13e2e40e1f1556825a5c8fed799caa1
4
- data.tar.gz: 99a834c8208aeddc4595dcb7cbd908b5ed8473b548aa0ec71b47a57e044ad135
3
+ metadata.gz: 82f2e2afc9696e62695257eba13de54c57617c9010b159a6c3cf06c6b9a532c7
4
+ data.tar.gz: 590c6a707c82d901ba98deaf74bd7e67ee8a11cec073a0e805cc70d237f09f31
5
5
  SHA512:
6
- metadata.gz: 0b7d0812516d424f31a9c92312dac2623096aed9245903d91cfce2db6f5704b0cae323fdf75e48fee3cb58e2ec202ebf6aa73106df75e1fa6c976a24a7c4337c
7
- data.tar.gz: 823fc827fe9d103b216c786180d7002e601da3ab17c863eadcdc813ef8992857a01f7c08d2002e257a707876ac16008c0c8fce233ef93890c8d0fa5965070a45
6
+ metadata.gz: b7b22077b6f5ee1f082255226d4abf8bf5104c616df19efec6c9b04f1ca7ebf8644fbd5f0e3666950b8ccead2d958a2956bda5b22751f26a27e18cc8bd0aa5e0
7
+ data.tar.gz: 1696982963c47a63199069744faef8f6fe96b592f9fb052f188a6d81f6113d277230beed5b3fe8e4b182b03e7550a7246a31737c0dd7021df99894a8412f7508
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2019 Cyril Kato
3
+ Copyright (c) 2015-2021 Cyril Kato
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,32 +1,21 @@
1
1
  # Aw
2
2
 
3
- [![Build Status](https://travis-ci.org/fixrb/aw.svg?branch=master)][travis]
3
+ [![Build Status](https://api.travis-ci.org/fixrb/aw.svg?branch=master)][travis]
4
4
  [![Code Climate](https://codeclimate.com/github/fixrb/aw/badges/gpa.svg)][codeclimate]
5
5
  [![Gem Version](https://badge.fury.io/rb/aw.svg)][gem]
6
- [![Inline docs](http://inch-ci.org/github/fixrb/aw.svg?branch=master)][inchpages]
7
- [![Documentation](http://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
6
+ [![Inline docs](https://inch-ci.org/github/fixrb/aw.svg?branch=master)][inchpages]
7
+ [![Documentation](https://img.shields.io/:yard-docs-38c800.svg)][rubydoc]
8
8
 
9
- > Aw, fork!
9
+ > Aw, fork! 😬
10
10
 
11
11
  Creates a subprocess to execute a block inside.
12
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/)
23
-
24
13
  ## Installation
25
14
 
26
15
  Add this line to your application's Gemfile:
27
16
 
28
17
  ```ruby
29
- gem 'aw'
18
+ gem "aw"
30
19
  ```
31
20
 
32
21
  And then execute:
@@ -48,9 +37,9 @@ Aw.fork! { 6 * 7 } # => 42
48
37
  Of course, it prevents from side effects:
49
38
 
50
39
  ```ruby
51
- arr = ['foo']
40
+ arr = ["foo"]
52
41
 
53
- Aw.fork! { arr << 'FUU' } # => ["foo", "FUU"]
42
+ Aw.fork! { arr << "FUU" } # => ["foo", "FUU"]
54
43
 
55
44
  arr # => ["foo"]
56
45
  ```
@@ -61,43 +50,29 @@ Exceptions raised within the block are propagated:
61
50
  Aw.fork! { nil + 1 } # => NoMethodError (undefined method `+' for nil:NilClass)
62
51
  ```
63
52
 
64
- ## Security
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:
53
+ ## Contact
73
54
 
74
- $ sha512sum pkg/aw-0.1.0.gem
75
- 548d9f669ded4e622182791a5390aaceae0bf2e557b0864f05a842b0be2c65e10e1fb8499f49a3b9efd0e8eaeb691351b1c670d6316ce49965a99683b1071389 pkg/aw-0.1.0.gem
55
+ * Source code: https://github.com/fixrb/aw
76
56
 
77
57
  ## Versioning
78
58
 
79
59
  __Aw__ follows [Semantic Versioning 2.0](https://semver.org/).
80
60
 
81
- ## Contributing
61
+ ## License
82
62
 
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
63
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
88
64
 
89
- ## License
65
+ ***
90
66
 
91
- See `LICENSE.md` file.
67
+ <p>
68
+ This project is sponsored by:<br />
69
+ <a href="https://sashite.com/"><img
70
+ src="https://github.com/fixrb/aw/raw/master/img/sashite.png"
71
+ alt="Sashite" /></a>
72
+ </p>
92
73
 
93
74
  [gem]: https://rubygems.org/gems/aw
94
75
  [travis]: https://travis-ci.org/fixrb/aw
95
76
  [codeclimate]: https://codeclimate.com/github/fixrb/aw
96
- [inchpages]: http://inch-ci.org/github/fixrb/aw
97
- [rubydoc]: http://rubydoc.info/gems/aw/frames
98
-
99
- ***
100
-
101
- This project is sponsored by:
102
-
103
- [![Sashite](https://pbs.twimg.com/profile_images/618485028322975744/PZ9qPuI__400x400.png)](https://sashite.com/)
77
+ [inchpages]: https://inch-ci.org/github/fixrb/aw
78
+ [rubydoc]: https://rubydoc.info/gems/aw
data/lib/aw.rb CHANGED
@@ -17,4 +17,4 @@ module Aw
17
17
  end
18
18
  end
19
19
 
20
- require_relative File.join('aw', 'fork')
20
+ require_relative File.join("aw", "fork")
data/lib/aw/fork.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "English"
4
+
3
5
  module Aw
4
6
  # The Fork class.
5
7
  class Fork
@@ -9,7 +11,7 @@ module Aw
9
11
  # @param write [IO] The write endpoint.
10
12
  def initialize(read, write)
11
13
  # Currently, not available on all platforms.
12
- raise 'fork() unimplemented' unless ::Process.respond_to?(:fork)
14
+ raise ::NotImplementedError, "fork()" unless ::Process.respond_to?(:fork)
13
15
 
14
16
  @read = read
15
17
  @write = write
@@ -34,11 +36,11 @@ module Aw
34
36
  result = read.read
35
37
  ::Process.wait(pid)
36
38
 
37
- # rubocop:disable MarshalLoad
39
+ # rubocop:disable Security/MarshalLoad
38
40
  ::Marshal.load(result).tap do |r|
39
41
  raise r if r.is_a?(::Exception)
40
42
  end
41
- # rubocop:enable MarshalLoad
43
+ # rubocop:enable Security/MarshalLoad
42
44
  end
43
45
 
44
46
  private
@@ -47,14 +49,16 @@ module Aw
47
49
  fork do
48
50
  read.close
49
51
 
52
+ # rubocop:disable Lint/RescueException
50
53
  begin
51
54
  result = yield
52
- rescue ::StandardError
55
+ rescue ::Exception
53
56
  result = $ERROR_INFO
54
57
  end
58
+ # rubocop:enable Lint/RescueException
55
59
 
56
60
  ::Marshal.dump(result, write)
57
- exit!(0)
61
+ exit!(true)
58
62
  end
59
63
  end
60
64
  end
metadata CHANGED
@@ -1,114 +1,137 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.12
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-10-22 00:00:00.000000000 Z
11
+ date: 2021-05-13 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: '2.0'
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: '2.0'
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: '13.0'
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: '13.0'
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.75'
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.75'
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.17'
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.17'
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.9'
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.9'
124
+ version: '0'
83
125
  description: Creates a subprocess to execute a block inside.
84
- email:
85
- - contact@cyril.email
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
133
  - lib/aw.rb
110
134
  - lib/aw/fork.rb
111
- - pkg_checksum
112
135
  homepage: https://github.com/fixrb/aw
113
136
  licenses:
114
137
  - MIT
@@ -121,15 +144,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
144
  requirements:
122
145
  - - ">="
123
146
  - !ruby/object:Gem::Version
124
- version: '0'
147
+ version: 2.7.0
125
148
  required_rubygems_version: !ruby/object:Gem::Requirement
126
149
  requirements:
127
150
  - - ">="
128
151
  - !ruby/object:Gem::Version
129
152
  version: '0'
130
153
  requirements: []
131
- rubygems_version: 3.0.3
154
+ rubygems_version: 3.1.4
132
155
  signing_key:
133
156
  specification_version: 4
134
- summary: Aw, fork!
157
+ summary: "Aw, fork! \U0001F62C"
135
158
  test_files: []
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.ruby-version
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
- .DS_Store
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
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
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.7
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.75'
22
- spec.add_development_dependency 'simplecov', '~> 0.17'
23
- spec.add_development_dependency 'yard', '~> 0.9'
24
- end
data/bin/console DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'aw'
6
-
7
- require 'irb'
8
- IRB.start
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -euo pipefail
4
- IFS=$'\n\t'
5
-
6
- bundle install
@@ -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
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") }