module Vagrant # Represents a "box," which is simply a packaged vagrant environment. # Boxes are simply `tar` files which contain an exported VirtualBox # virtual machine, at the least. They are created with `vagrant package` # and may contain additional files if specified by the creator. This # class serves to help manage these boxes, although most of the logic # is kicked out to actions. # # What can the {Box} class do? # # * Find boxes # * Add existing boxes (from some URI) # * Delete existing boxes # # # Finding Boxes # # Using the {Box.find} method, you can search for existing boxes. This # method will return `nil` if none is found or an instance of {Box} # otherwise. # # box = Vagrant::Box.find("base") # if box.nil? # puts "Box not found!" # else # puts "Box exists at #{box.directory}" # end # # # Adding a Box # # Boxes can be added from any URI. Some schemas aren't supported; if this # is the case, the error will output to the logger. # # Vagrant::Box.add("foo", "http://myfiles.com/foo.box") # # # Destroying a box # # Boxes can be deleted as well. This method is _final_ and there is no way # to undo this action once it is completed. # # box = Vagrant::Box.find("foo") # box.destroy # class Box < Actions::Runner # The name of the box. attr_accessor :name # The URI for a new box. This is not available for existing boxes. attr_accessor :uri # The temporary path to the downloaded or copied box. This should # only be used internally. attr_accessor :temp_path class <