[前][次][番号順一覧][スレッド一覧]

ruby-changes:74340

From: Nobuyoshi <ko1@a...>
Date: Fri, 4 Nov 2022 15:44:07 +0900 (JST)
Subject: [ruby-changes:74340] 570dee15a6 (master): sync_default_gems.rb: accept log input from other than STDIN

https://git.ruby-lang.org/ruby.git/commit/?id=570dee15a6

From 570dee15a6939f1a3c8cf301202a1c508c2c2a33 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 4 Nov 2022 15:17:49 +0900
Subject: sync_default_gems.rb: accept log input from other than STDIN

---
 tool/sync_default_gems.rb | 10 ++++++----
 1 file 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 = https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L418
   |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" https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L659
   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
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]