lib/fontist/import/formula_builder.rb in fontist-1.12.0 vs lib/fontist/import/formula_builder.rb in fontist-1.13.0
- old
+ new
@@ -71,11 +71,11 @@
resource_options_with_sha
end
end
def resource_options_without_sha
- { urls: [@url] + mirrors }
+ { urls: [@url] + mirrors, file_size: file_size }
end
def resource_options_with_sha
urls = []
sha = []
@@ -84,11 +84,11 @@
sha << Digest::SHA256.file(path).to_s
end
sha = prepare_sha256(sha)
- { urls: urls, sha256: sha }
+ { urls: urls, sha256: sha, file_size: file_size }
end
def downloads
yield @url, @archive
@@ -116,9 +116,13 @@
return output.first if output.size == 1
checksums = output.join(", ")
Fontist.ui.error("WARN: SHA256 differs (#{checksums})")
output
+ end
+
+ def file_size
+ File.size(@archive)
end
def font_collections
return if @font_collection_files.empty?