manifests.Parse("Vagrantfile", ...) currently returns UnknownFileError. Add a static Vagrantfile parser for box dependencies. A Vagrantfile is executable Ruby, so parsing must not evaluate the file, interpolate strings, read constants, or run helper methods.
Recognize literal assignments to:
config.vm.box
config.vm.box_version
config.vm.box_url
config.vm.box_download_checksum
config.vm.box_download_checksum_type
Return a literal config.vm.box value as a direct runtime dependency. Keep namespaced names such as hashicorp/bionic64 intact, preserve box_version as the declared constraint, and use a literal box_url as its source. When both checksum fields are literal, return the integrity value with its algorithm, such as sha256-<digest>. If either half is dynamic or missing, do not construct an integrity value.
Vagrant's machine settings define these fields. The documentation says that box_url may be an HTTP URL, a file:// URL, or an array of URLs, and lists md5, sha1, sha256, sha384, and sha512 as checksum types. Initial support can stay limited to a single literal string and skip arrays without failing the file. Vagrant's box versioning documentation describes exact versions and constraints.
The Vagrant source declares the fields in VMConfig, its generated Vagrantfile template shows the usual box, version, and URL assignments, and the box handling test shows how checksum fields travel with the box request.
Parse single- and double-quoted literal strings with normal whitespace and trailing comments. Skip an individual assignment when its value is an interpolated string, variable, method call, concatenation, environment lookup, or another Ruby expression. Other Vagrant configuration must not affect the box result.
Generated PURLs should follow accepted Vagrant type rules. Vagrant remains a candidate PURL type, so this work should not invent namespace or provider qualifiers before that definition is accepted.
Add parser registration, unit tests, fixtures, and README entries. Tests should cover namespaced boxes, exact versions and version constraints, a custom catalog URL, each documented checksum type, comments, missing optional fields, unrelated configuration, and dynamic expressions mixed with valid literal assignments.
manifests.Parse("Vagrantfile", ...)currently returnsUnknownFileError. Add a static Vagrantfile parser for box dependencies. A Vagrantfile is executable Ruby, so parsing must not evaluate the file, interpolate strings, read constants, or run helper methods.Recognize literal assignments to:
config.vm.boxconfig.vm.box_versionconfig.vm.box_urlconfig.vm.box_download_checksumconfig.vm.box_download_checksum_typeReturn a literal
config.vm.boxvalue as a direct runtime dependency. Keep namespaced names such ashashicorp/bionic64intact, preservebox_versionas the declared constraint, and use a literalbox_urlas its source. When both checksum fields are literal, return the integrity value with its algorithm, such assha256-<digest>. If either half is dynamic or missing, do not construct an integrity value.Vagrant's machine settings define these fields. The documentation says that
box_urlmay be an HTTP URL, afile://URL, or an array of URLs, and listsmd5,sha1,sha256,sha384, andsha512as checksum types. Initial support can stay limited to a single literal string and skip arrays without failing the file. Vagrant's box versioning documentation describes exact versions and constraints.The Vagrant source declares the fields in
VMConfig, its generated Vagrantfile template shows the usual box, version, and URL assignments, and the box handling test shows how checksum fields travel with the box request.Parse single- and double-quoted literal strings with normal whitespace and trailing comments. Skip an individual assignment when its value is an interpolated string, variable, method call, concatenation, environment lookup, or another Ruby expression. Other Vagrant configuration must not affect the box result.
Generated PURLs should follow accepted Vagrant type rules. Vagrant remains a candidate PURL type, so this work should not invent namespace or provider qualifiers before that definition is accepted.
Add parser registration, unit tests, fixtures, and README entries. Tests should cover namespaced boxes, exact versions and version constraints, a custom catalog URL, each documented checksum type, comments, missing optional fields, unrelated configuration, and dynamic expressions mixed with valid literal assignments.