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

sync_default_gems.rb: accept log input from other than STDIN

This commit is contained in:
Nobuyoshi Nakada 2022-11-04 15:17:49 +09:00
parent 1956fb9b78
commit 570dee15a6
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -418,8 +418,8 @@ IGNORE_FILE_PATTERN =
|rakelib\/.*
)\z/mx
def message_filter(repo, sha)
log = STDIN.read
def message_filter(repo, sha, input: ARGF)
log = input.read
log.delete!("\r")
url = "https://github.com/#{repo}"
subject, log = log.split(/\n(?:[\s\t]*(?:\n|\z))/, 2)
@ -659,8 +659,10 @@ when "list"
end
when "--message-filter"
ARGV.shift
abort unless ARGV.size == 2
message_filter(*ARGV)
if ARGV.size < 2
abort "usage: #{$0} --message-filter repository commit-hash [input...]"
end
message_filter(*ARGV.shift(2))
exit
when "rdoc-ref"
ARGV.shift