Skip to content

Commit

Permalink
Use numbered parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
crdx committed Oct 9, 2024
1 parent 742ecfd commit 5a39dd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/enparallel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include Enparallel
class Main
def self.run
cli = CLI.parse(ARGV, $stdin)
tasks = cli.inputs.map { |input| Task.new(cli.command, input) }
tasks = cli.inputs.map { Task.new(cli.command, _1) }
pool = ThreadPool.new(tasks, cli.workers, cli.pick)
new(pool).run
end
Expand Down Expand Up @@ -56,7 +56,7 @@ class Main
end

def all_paths_available(paths)
paths.all? { |path| !File.exist?(path) }
paths.all? { !File.exist?(_1) }
end

def next_id
Expand Down
2 changes: 1 addition & 1 deletion lib/enparallel/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def interpolate_unsafe(replacement)
private

def replace(replacement)
@args.map { |arg| arg.gsub('{}', replacement) }
@args.map { _1.gsub('{}', replacement) }
end
end
end

0 comments on commit 5a39dd7

Please sign in to comment.