pretty_multitask 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pretty_multitask.rb +1 -0
- data/lib/pretty_multitask/run_callable.rb +1 -0
- data/lib/pretty_multitask/trapper.rb +21 -0
- data/lib/pretty_multitask/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3925750f68500c7985c8b7232c197d09b42eabf80d1d16f45cce3d8c7e99626b
|
4
|
+
data.tar.gz: 4bea26717393ed203c85d9116fe0e56e5d31e86bef474ea72940349ea028aaef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b956e25b5c4d0c493da585214be1d56fe2f3da5691057c6a0955fb50a4ac8a4cf81764afabef786e8c326d6dbc6273235da027b4d46f480f62d94a6ed3e09973
|
7
|
+
data.tar.gz: 05e93b9eee198a1ec2a816fcbaac69bcdbf8ebbb9e402324d8cba26e0faf4a949afa8ee96e596c2e1b50ddf308f6978e0330ed31c095452adbc0b84962bca3ce
|
data/lib/pretty_multitask.rb
CHANGED
@@ -13,6 +13,7 @@ require 'fileutils'
|
|
13
13
|
|
14
14
|
# Main module
|
15
15
|
module PrettyMultitask
|
16
|
+
require "#{__dir__}/pretty_multitask/trapper"
|
16
17
|
require "#{__dir__}/pretty_multitask/color"
|
17
18
|
require "#{__dir__}/pretty_multitask/runner"
|
18
19
|
require "#{__dir__}/pretty_multitask/run_callable"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PrettyMultitask
|
4
|
+
module Trapper
|
5
|
+
module_function
|
6
|
+
|
7
|
+
PIDS ||= Set.new
|
8
|
+
def trap(pid)
|
9
|
+
PIDS << pid
|
10
|
+
%w[SIGINT SIGTERM SIGHUP].each do |sig|
|
11
|
+
Signal.trap(sig) do
|
12
|
+
begin
|
13
|
+
PIDS.each { |pid| Process.kill sig, pid }
|
14
|
+
rescue Errno::ESRCH
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_multitask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiago Lopo Da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tlopo-executor
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/pretty_multitask/color.rb
|
88
88
|
- lib/pretty_multitask/run_callable.rb
|
89
89
|
- lib/pretty_multitask/runner.rb
|
90
|
+
- lib/pretty_multitask/trapper.rb
|
90
91
|
- lib/pretty_multitask/version.rb
|
91
92
|
- pretty_multitask.gemspec
|
92
93
|
homepage: https://github.com/tlopo-ruby/tlopo-executor
|