lib/pdk/cli/exec_group.rb in pdk-2.7.1 vs lib/pdk/cli/exec_group.rb in pdk-3.0.0
- old
+ new
@@ -35,12 +35,12 @@
# Register something to execute as a group
#
# @param block [Block] A block of ruby to execute
#
# @api private
- def register(&_block)
- raise PDK::CLI::FatalError, 'No block registered' unless block_given?
+ def register(&block)
+ raise PDK::CLI::FatalError, 'No block registered' unless block
end
# The return code of running all registered blocks
#
# @return [int] The highest exit code from the blocks
@@ -93,9 +93,10 @@
end
def exit_code
@threads.each(&:join)
return 0 if @exit_codes.empty?
+
@exit_codes.max
end
end
end
end