From 597416e0d68018d49864ea61a5a768d816da6d4b 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 23:08:08 +0800 Subject: [PATCH] fix error --- gallery.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gallery.gemspec b/gallery.gemspec index 06ba66e..419e85b 100644 --- a/gallery.gemspec +++ b/gallery.gemspec @@ -24,7 +24,7 @@ if bundle_update_flag puts "Checking gallery 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_gallery_widget_info.each do |h|