Skip to content

Commit

Permalink
Merge pull request #1979 from rubocop/fix-wait
Browse files Browse the repository at this point in the history
Fix problem with `Open3.popen3` where `confirm_documentation` task never finishes waiting for child processes
  • Loading branch information
pirj authored Oct 18, 2024
2 parents a72a32d + 9e4855f commit c155235
Show file tree
Hide file tree
Showing 2 changed files with 468 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ end

desc 'Confirm documentation is up to date'
task confirm_documentation: :generate_cops_documentation do
_, _, _, process =
Open3.popen3('git diff --exit-code docs/')

unless process.value.success?
raise 'Please run `rake generate_cops_documentation` ' \
'and add docs/ to the commit.'
stdout, _stderr, status =
Open3.capture3('git diff --exit-code docs/')

unless status.success?
warn 'Documentation is out of sync:'
warn stdout
warn 'Please run `rake generate_cops_documentation` ' \
'and add docs/ to the commit.'
exit 1
end
end

Expand Down
Loading

0 comments on commit c155235

Please sign in to comment.