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:
parent
1956fb9b78
commit
570dee15a6
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue