1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

sync_default_gems: Add rdoc-ref command to test

This commit is contained in:
Nobuyoshi Nakada 2022-10-12 11:52:46 +09:00
parent df588440ee
commit 2b5d4fe28d
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -642,6 +642,17 @@ when "--message-filter"
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