diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-01-11 00:55:10 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-01-13 20:34:08 +0900 |
commit | 3ecffae8e81b8c508b4b964643a1468718452054 (patch) | |
tree | 7e6a8b1814c194a6aa047e0557716a1f9a2e7896 /.github/workflows/check_misc.yml | |
parent | 94d6d6d93fa40b5f8dcdda6aa0e4b300ee61085c (diff) | |
download | ruby-3ecffae8e81b8c508b4b964643a1468718452054.tar.gz |
[DOC] Extract tool/update-NEWS-gemlist.rb
Diffstat (limited to '.github/workflows/check_misc.yml')
-rw-r--r-- | .github/workflows/check_misc.yml | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml index f6b09ae2a9..b41b58795f 100644 --- a/.github/workflows/check_misc.yml +++ b/.github/workflows/check_misc.yml @@ -66,30 +66,7 @@ jobs: - name: Maintain updated gems list in NEWS run: | - #!ruby - require 'json' - news = File.read("NEWS.md") - prev = news[/since the \*+(\d+\.\d+\.\d+)\*+/, 1] - prevs = [prev, prev.sub(/\.\d+\z/, '')] - %W[default].each do |type| - last = JSON.parse(File.read("#{type}_gems.json"))['gems'].filter_map do |g| - v = g['versions'].values_at(*prevs).compact.first - g = g['gem'] - g = 'RubyGems' if g == 'rubygems' - [g, v] if v - end.to_h - changed = File.foreach("gems/#{type}_gems").filter_map do |l| - next if l.start_with?("#") - g, v = l.split(" ", 3) - [g, v] unless last[g] == v - end - news.sub!(/^\*( +)The following #{type} gems? are updated\.\n+\K(?: \1\* .*\n)*/) do - mark = "#{$1} * " - changed.map {|g, v|"#{mark}#{g} #{v}\n"}.join("") - end or next - File.write("NEWS.md", news) - end - shell: ruby {0} + ruby tool/update-NEWS-gemlist.rb default - name: Check diffs id: diff |