Package downloading now mostly working

This commit is contained in:
2021-11-16 09:34:41 -06:00
parent d0d8683c4e
commit db97b5a3ab
3 changed files with 79 additions and 6 deletions

View File

@@ -36,13 +36,13 @@ class W3DHub
def parse_dependencies
@document.root.elements.each("//Dependency") do |element|
@files.push(Dependency.new(element))
@dependencies.push(Dependency.new(element))
end
end
# TODO: Support patches? Are they still a thing>
# TODO: Support patches
class ManifestFile
attr_reader :name, :checksum, :package, :removed_since
attr_reader :name, :checksum, :package, :removed_since, :from
def initialize(xml)
@data = xml
@@ -51,11 +51,22 @@ class W3DHub
@checksum = @data["checksum"]
@package = @data["package"]
@removed_since = @data["removedsince"]
xml.elements.each("Patch") do |patch|
@patch = true
@from = patch["from"]
@package = patch["package"]
end
end
def removed?
@removed_since
end
def patch?
@patch
end
end
class Dependency