lib/vagrant/box_metadata.rb in vagrant-unbundled-2.2.19.0 vs lib/vagrant/box_metadata.rb in vagrant-unbundled-2.3.2.0
- old
+ new
@@ -3,10 +3,13 @@
module Vagrant
# BoxMetadata represents metadata about a box, including the name
# it should have, a description of it, the versions it has, and
# more.
class BoxMetadata
+
+ autoload :Remote, "vagrant/box_metadata/remote"
+
# The name that the box should be if it is added.
#
# @return [String]
attr_accessor :name
@@ -17,11 +20,11 @@
# Loads the metadata associated with the box from the given
# IO.
#
# @param [IO] io An IO object to read the metadata from.
- def initialize(io)
+ def initialize(io, **_)
begin
@raw = JSON.load(io)
rescue JSON::ParserError => e
raise Errors::BoxMetadataMalformed,
error: e.to_s
@@ -94,11 +97,11 @@
# The version that this Version object represents.
#
# @return [String]
attr_accessor :version
- def initialize(raw=nil)
+ def initialize(raw=nil, **_)
return if !raw
@version = raw["version"]
@provider_map = (raw["providers"] || []).map do |p|
[p["name"].to_sym, p]
@@ -144,10 +147,10 @@
# The type of checksum (if any) associated with this provider.
#
# @return [String]
attr_accessor :checksum_type
- def initialize(raw)
+ def initialize(raw, **_)
@name = raw["name"]
@url = raw["url"]
@checksum = raw["checksum"]
@checksum_type = raw["checksum_type"]
end