fasten 0.16.0 → 0.18.0

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: d3ee0cd8e9128821758efe48a22b7a46150383006040c3681a91ec7a90cbce50
4
- data.tar.gz: d0e85d0f4931e26145d4733a3d9e7f3caff9878fb2e44397b6a95102d0fdfa34
3
+ metadata.gz: 93858ac8aab1bd5bbbb63aaf5475be37beaf50f43e4b6677822558ae21fdc024
4
+ data.tar.gz: 0bce3109d9d5aa7499746fe298427d40e94e6305a617e5b5ac6f321e1c808755
5
5
  SHA512:
6
- metadata.gz: f701744c40a44fe18d352841f3210136f4a16487bacd4e982b772311edceb5c406d9b579a67c4513243a8200a3a82dab7592d6942a113677b43b54cf2a5fd60f
7
- data.tar.gz: b1ca8984102cdf0223851b62206719eaf369252dfe40c8e3ff10cb0b1fdaa070713f0f83b476fcb2127e61249bb283b6c58fa866338f064d3aecbaa61abc4b2f
6
+ metadata.gz: 740fc94594c962bb8decf84dafc2c4952db90c4ccf8bccb6522a3920d0621ebb81dfe5a979a32f862baca1d0de4e9d56a5fad550614bd363bc1784e30267758e
7
+ data.tar.gz: fff1959d04192828f7c44e6c29fcf813c39877f34f719921eb0bd672eb66772f78b51a6410f3c06baa69ee64c7b12eda5dbf88d9f29fadd289f2b599a03d8e51
data/.rubocop.yml CHANGED
@@ -33,4 +33,4 @@ Style/FormatStringToken:
33
33
 
34
34
  AllCops:
35
35
  NewCops: enable
36
- TargetRubyVersion: 2.6
36
+ TargetRubyVersion: 3.0
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.6.6
1
+ ruby 3.0.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fasten (0.16.0)
4
+ fasten (0.18.0)
5
5
  binding_of_caller
6
6
  hirb
7
7
  os
@@ -14,14 +14,14 @@ GEM
14
14
  binding_of_caller (1.0.0)
15
15
  debug_inspector (>= 0.0.1)
16
16
  coderay (1.1.3)
17
- curses (1.4.1)
17
+ curses (1.4.2)
18
18
  debug_inspector (1.1.0)
19
19
  diff-lcs (1.4.4)
20
20
  hirb (0.7.3)
21
21
  method_source (1.0.0)
22
- os (1.1.1)
23
- parallel (1.20.1)
24
- parser (3.0.1.1)
22
+ os (1.1.4)
23
+ parallel (1.21.0)
24
+ parser (3.0.2.0)
25
25
  ast (~> 2.4.1)
26
26
  pry (0.14.1)
27
27
  coderay (~> 1.1)
@@ -42,25 +42,24 @@ GEM
42
42
  rspec-mocks (3.10.2)
43
43
  diff-lcs (>= 1.2.0, < 2.0)
44
44
  rspec-support (~> 3.10.0)
45
- rspec-support (3.10.2)
46
- rubocop (1.16.0)
45
+ rspec-support (3.10.3)
46
+ rubocop (1.22.3)
47
47
  parallel (~> 1.10)
48
48
  parser (>= 3.0.0.0)
49
49
  rainbow (>= 2.2.2, < 4.0)
50
50
  regexp_parser (>= 1.8, < 3.0)
51
51
  rexml
52
- rubocop-ast (>= 1.7.0, < 2.0)
52
+ rubocop-ast (>= 1.12.0, < 2.0)
53
53
  ruby-progressbar (~> 1.7)
54
54
  unicode-display_width (>= 1.4.0, < 3.0)
55
- rubocop-ast (1.7.0)
55
+ rubocop-ast (1.12.0)
56
56
  parser (>= 3.0.1.1)
57
- rubocop-rake (0.5.1)
58
- rubocop
59
- rubocop-rspec (2.3.0)
57
+ rubocop-rake (0.6.0)
60
58
  rubocop (~> 1.0)
61
- rubocop-ast (>= 1.1.0)
59
+ rubocop-rspec (2.5.0)
60
+ rubocop (~> 1.19)
62
61
  ruby-progressbar (1.11.0)
63
- unicode-display_width (2.0.0)
62
+ unicode-display_width (2.1.0)
64
63
 
65
64
  PLATFORMS
66
65
  ruby
@@ -77,4 +76,4 @@ DEPENDENCIES
77
76
  rubocop-rspec
78
77
 
79
78
  BUNDLED WITH
80
- 1.17.2
79
+ 2.2.22
data/README.md CHANGED
@@ -47,7 +47,7 @@ It has been released so people can try it and make feature requests, comments an
47
47
  - [x] Console is the default if STDOUT/STDIN is not a tty
48
48
  - [x] Display each task as is being finished
49
49
  - [ ] Calculate ETA, assuming all tasks take same time
50
- - [ ] Calculate ETA, based on saved tasks statistics
50
+ - [x] Calculate ETA, based on saved tasks statistics
51
51
 
52
52
 
53
53
  ### CLI
data/fasten.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.description = 'Fasten your seatbelts! Run jobs in parallel, intelligently.'
12
12
  spec.homepage = 'https://github.com/a0/a0-fasten-ruby/'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.0.2')
15
15
 
16
16
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
17
17
 
data/lib/fasten/runner.rb CHANGED
@@ -28,7 +28,7 @@ module Fasten
28
28
  @tasks = TaskManager.new(targets: options[:targets] || [], runner: self)
29
29
  @workers = []
30
30
 
31
- reconfigure(options)
31
+ reconfigure(**options)
32
32
  end
33
33
 
34
34
  def reconfigure(**options)
@@ -40,7 +40,9 @@ module Fasten
40
40
  end
41
41
 
42
42
  def task(name, **opts, &block)
43
- tasks << task = Task.new(name: name, **opts, block: block)
43
+ opts[:name] = name
44
+ opts[:block] = block
45
+ tasks << task = Task.new(**opts)
44
46
 
45
47
  task
46
48
  end
@@ -111,7 +113,7 @@ module Fasten
111
113
  dispatch_pending_tasks
112
114
  end
113
115
 
114
- break if tasks.no_running? && tasks.no_waiting? || state == :QUIT
116
+ break if (tasks.no_running? && tasks.no_waiting?) || state == :QUIT
115
117
  end
116
118
 
117
119
  remove_all_workers
@@ -129,7 +131,7 @@ module Fasten
129
131
  end
130
132
 
131
133
  def should_wait_for_running_tasks?
132
- tasks.running? && (tasks.no_waiting? || tasks.failed? || %i[PAUSING QUITTING].include?(state)) || tasks.running.map(&:weight).sum >= jobs
134
+ (tasks.running? && (tasks.no_waiting? || tasks.failed? || %i[PAUSING QUITTING].include?(state))) || tasks.running.map(&:weight).sum >= jobs
133
135
  end
134
136
 
135
137
  def wait_for_running_tasks
@@ -14,7 +14,7 @@ module Fasten
14
14
  params = {}
15
15
  end
16
16
 
17
- task name, params
17
+ task name, **params
18
18
  end
19
19
 
20
20
  log_info "Loaded #{items.count} tasks from #{path}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fasten
4
- VERSION = '0.16.0'
4
+ VERSION = '0.18.0'
5
5
  end
data/lib/fasten.rb CHANGED
@@ -113,7 +113,7 @@ module Fasten
113
113
 
114
114
  @options[:targets] = ARGV.to_a
115
115
 
116
- runner @options
116
+ runner **@options
117
117
  @load_path = Dir['fasten/*_fasten.rb'] if @load_path.empty?
118
118
  load_fasten @load_path
119
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fasten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldrin Martoq
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-08 00:00:00.000000000 Z
11
+ date: 2021-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses
@@ -195,14 +195,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - ">="
197
197
  - !ruby/object:Gem::Version
198
- version: 2.6.0
198
+ version: 3.0.2
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ">="
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubygems_version: 3.0.3
205
+ rubygems_version: 3.2.22
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: Fasten your seatbelts! Run jobs in parallel, intelligently.