This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 5f5d0e8 Fix up sort order
5f5d0e8 is described below
commit 5f5d0e8804154dc323d15ac7358847c3ee57a295
Author: Sebb <[email protected]>
AuthorDate: Sun Apr 4 17:37:37 2021 +0100
Fix up sort order
---
www/secretary/workbench/views/actions/burst.json.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/www/secretary/workbench/views/actions/burst.json.rb
b/www/secretary/workbench/views/actions/burst.json.rb
index 3284ff4..c1a9331 100644
--- a/www/secretary/workbench/views/actions/burst.json.rb
+++ b/www/secretary/workbench/views/actions/burst.json.rb
@@ -12,7 +12,8 @@ begin
Dir.mktmpdir do |dir|
Kernel.system 'pdfseparate', source.path, "#{dir}/page_%d.pdf"
- pages = Dir["#{dir}/*.pdf"].sort_by {|name| name[/d+/].to_i}
+ # The directory name may include digits, so narrow down the matching
+ pages = Dir["#{dir}/page_*.pdf"].sort_by {|name| name[/page_(\d+)/,1].to_i}
format = @selected.sub(/\.\w+$/, '') +
"-%0#{pages.length.to_s.length}d.pdf"