We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6f7f12 commit a8a04c2Copy full SHA for a8a04c2
lib/jekyll-import/importers/pebble.rb
@@ -15,7 +15,7 @@ def self.specify_options(c)
15
end
16
17
def self.process(opts)
18
- options = { directory => opts.fetch("directory", "") }
+ options = { :directory => opts.fetch("directory", "") }
19
20
FileUtils.mkdir_p("_posts")
21
FileUtils.mkdir_p("_drafts")
@@ -28,11 +28,9 @@ def self.process(opts)
28
29
30
def self.traverse_posts_within(directory, &block)
31
- Dir.foreach(directory) do |fd|
+ Dir.each_child(directory) do |fd|
32
path = File.join(directory, fd)
33
- if fd.include?(".") || fd.include?("..")
34
- next
35
- elsif File.directory?(path)
+ if File.directory?(path)
36
traverse_posts_within(path, &block)
37
elsif path.end_with?("xml")
38
yield(path) if block_given?
0 commit comments