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 46d1ba0 Use File.join for pathname construction
46d1ba0 is described below
commit 46d1ba0fcc1edb1d6b030add3d01955d210fcd41
Author: Sebb <[email protected]>
AuthorDate: Sun Feb 14 14:20:12 2021 +0000
Use File.join for pathname construction
---
lib/whimsy/asf/config.rb | 2 +-
tools/mboxhdr2csv.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/whimsy/asf/config.rb b/lib/whimsy/asf/config.rb
index c8cfb94..dfe2740 100644
--- a/lib/whimsy/asf/config.rb
+++ b/lib/whimsy/asf/config.rb
@@ -45,7 +45,7 @@ module ASF
root_config = "#{@root}/.whimsy"
if File.exist? root_config
@config.merge! YAML.load_file(root_config) || {}
- @root = '/srv' unless Dir.exist? "#{@root}/whimsy"
+ @root = '/srv' unless Dir.exist? File.join(@root, "whimsy")
end
# capture root
diff --git a/tools/mboxhdr2csv.rb b/tools/mboxhdr2csv.rb
index 61653f1..c10d92c 100644
--- a/tools/mboxhdr2csv.rb
+++ b/tools/mboxhdr2csv.rb
@@ -362,7 +362,7 @@ module MboxUtils
# Side effect: writes out f.chomp(ext).json files
# @note writes string VERSION for differentiating from other *.json
def scan_dir_mbox2stats(dir, ext = MBOX_EXT)
- Dir["#{dir}/**/*#{ext}"].sort.each do |f|
+ Dir[File.join(dir, "**", "*#{ext}")].sort.each do |f|
mails, errs = mbox2stats(f)
File.open("#{f.chomp(ext)}.json", "w") do |fout|
fout.puts JSON.pretty_generate([VERSION, mails, errs])