Fix linter issues

This commit is contained in:
Alex Ling 2022-05-19 12:41:07 +00:00
parent 0ed565519b
commit f18f6a5418

View File

@ -15,12 +15,10 @@ abstract class Entry
def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
# TODO: check node? and select proper subclass # TODO: check node? and select proper subclass
begin
ZippedEntry.new ctx, node ZippedEntry.new ctx, node
rescue e rescue e
DirectoryEntry.new ctx, node DirectoryEntry.new ctx, node
end end
end
def build_json(*, slim = false) def build_json(*, slim = false)
JSON.build do |json| JSON.build do |json|
@ -391,9 +389,9 @@ class DirectoryEntry < Entry
end end
@id = id @id = id
mtimes = sorted_files.map { |file_path| File.info(file_path).modification_time } @mtime = sorted_files.map do |file_path|
@mtime = mtimes.max File.info(file_path).modification_time
end.max
@pages = sorted_files.size @pages = sorted_files.size
end end