lib/fontist/import/recursive_extraction.rb in fontist-1.11.2 vs lib/fontist/import/recursive_extraction.rb in fontist-1.11.3
- old
+ new
@@ -2,11 +2,11 @@
module Fontist
module Import
class RecursiveExtraction
LICENSE_PATTERN =
- /(ofl\.txt|ufl\.txt|licenses?\.txt|license|copying)$/i.freeze
+ /(ofl\.txt|ufl\.txt|licenses?\.txt|license(\.md)?|copying)$/i.freeze
def initialize(archive, subarchive: nil, subdir: nil)
@archive = archive
@subdir = subdir
@operations = {}
@@ -68,9 +68,11 @@
@extracted = true
end
def extract_data(archive)
Excavate::Archive.new(path(archive)).files(recursive_packages: true) do |path|
+ next unless File.file?(path)
+
match_license(path)
match_font(path) if font_directory?(path)
end
end