Skip to content

Commit

Permalink
sync_default_gems: Add rdoc-ref command to test
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Oct 12, 2022
1 parent df58844 commit 2b5d4fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tool/sync_default_gems.rb
Expand Up @@ -642,6 +642,17 @@ def update_default_gems(gem, release: false)
abort unless ARGV.size == 2
message_filter(*ARGV)
exit
when "rdoc-ref"
ARGV.shift
pattern = ARGV.empty? ? %w[*.c *.rb *.rdoc] : ARGV
result = pipe_readlines(%W"git grep -z -l -F [https://docs.ruby-lang.org/en/master/ --" + pattern)
result.inject(false) do |changed, file|
if replace_rdoc_ref(file)
puts "replaced rdoc-ref in #{file}"
changed = true
end
changed
end
when nil, "-h", "--help"
puts <<-HELP
\e[1mSync with upstream code of default libraries\e[0m
Expand Down

0 comments on commit 2b5d4fe

Please sign in to comment.