From 1d8b2b04b6491d0ba3c94f6a7f6176615e7dacf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 27 Nov 2021 22:57:30 +0800 Subject: [PATCH] fix error --- announcement.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/announcement.gemspec b/announcement.gemspec index f7c641d..3726380 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -116,7 +116,7 @@ if bundle_update_flag puts "Checking announcement widgets" widget_info = info["widgets"].sort_by{|h| h["filename"].to_i} rescue [] update_flag = false - last_index = widget_info[-1]["filename"].match(/\d+/)[0].to_i rescue nil + last_index = widget_info.collect{|v| v["filename"].to_s.scan(/\d+/).collect{|v1| v1.to_i}}.flatten.sort[-1] rescue nil if !last_index.nil? idx_regex = /^(\d+[\. \t]*)|[ \t]+$/ default_announcement_widget_info.each do |h|