From a8a04c253f6e7abced9a2b324bf666d643d0ed69 Mon Sep 17 00:00:00 2001 From: midzer Date: Tue, 23 Jul 2024 07:01:18 +0200 Subject: [PATCH] Fix erroneous cosmetic changes in Pebble importer (#546) Merge pull request 546 --- lib/jekyll-import/importers/pebble.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/jekyll-import/importers/pebble.rb b/lib/jekyll-import/importers/pebble.rb index 13870d4a..19afab27 100644 --- a/lib/jekyll-import/importers/pebble.rb +++ b/lib/jekyll-import/importers/pebble.rb @@ -15,7 +15,7 @@ def self.specify_options(c) end def self.process(opts) - options = { directory => opts.fetch("directory", "") } + options = { :directory => opts.fetch("directory", "") } FileUtils.mkdir_p("_posts") FileUtils.mkdir_p("_drafts") @@ -28,11 +28,9 @@ def self.process(opts) end def self.traverse_posts_within(directory, &block) - Dir.foreach(directory) do |fd| + Dir.each_child(directory) do |fd| path = File.join(directory, fd) - if fd.include?(".") || fd.include?("..") - next - elsif File.directory?(path) + if File.directory?(path) traverse_posts_within(path, &block) elsif path.end_with?("xml") yield(path) if block_given?