diff options
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-x | tool/sync_default_gems.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 7543b4f73c..d6b20a82bf 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -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 |