def all
      results = []

      with_collection_lock do
        @logger.debug("Finding all boxes in: #{@directory}")
        @directory.children(true).each do |child|
          # Ignore non-directories, since files are not interesting to
          # us in our folder structure.
          next if !child.directory?

          box_name = undir_name(child.basename.to_s)

          # Otherwise, traverse the subdirectories and see what versions
          # we have.
          child.children(true).each do |versiondir|
            next if !versiondir.directory?
            next if versiondir.basename.to_s.start_with?(".")

            version = versiondir.basename.to_s

            versiondir.children(true).each do |provider|
              # Ensure version of box is correct before continuing
              if !Gem::Version.correct?(version)
                ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")
                ui.warn(I18n.t("vagrant.box_version_malformed",
                              version: version, box_name: box_name))
                @logger.debug("Invalid version #{version} for box #{box_name}")
                next
              end

              # Verify this is a potentially valid box. If it looks
              # correct enough then include it.
              if provider.directory? && provider.join("metadata.json").file?
                provider_name = provider.basename.to_s.to_sym
                @logger.debug("Box: #{box_name} (#{provider_name}, #{version})")
                results << [box_name, version, provider_name]
              else
                @logger.debug("Invalid box #{box_name}, ignoring: #{provider}")
              end
            end
          end
        end
      end
      # Sort the list to group like providers and properly ordered versions
      results.sort_by! do |box_result|
        [box_result[0], box_result[2], Gem::Version.new(box_result[1])]
      end
      results
    end
def all
      results = []

      with_collection_lock do
        @logger.debug("Finding all boxes in: #{@directory}")
        @directory.children(true).each do |child|
          # Ignore non-directories, since files are not interesting to
          # us in our folder structure.
          next if !child.directory?

          box_name = undir_name(child.basename.to_s)

          # Otherwise, traverse the subdirectories and see what versions
          # we have.
          child.children(true).each do |versiondir|
            next if !versiondir.directory?
            next if versiondir.basename.to_s.start_with?(".")

            version = versiondir.basename.to_s

            versiondir.children(true).each do |provider|
              # Ensure version of box is correct before continuing
              if !Gem::Version.correct?(version)
                ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")
                ui.warn(I18n.t("vagrant.box_version_malformed",
                              version: version, box_name: box_name))
                @logger.debug("Invalid version #{version} for box #{box_name}")
                next
              end

              # Verify this is a potentially valid box. If it looks
              # correct enough then include it.
              if provider.directory? && provider.join("metadata.json").file?
                provider_name = provider.basename.to_s.to_sym
                @logger.debug("Box: #{box_name} (#{provider_name}, #{version})")
                results << [box_name, version, provider_name]
              else
                @logger.debug("Invalid box #{box_name}, ignoring: #{provider}")
              end
            end
          end
        end
      end
      # Sort the list to group like providers and properly ordered versions
      results.sort_by! do |box_result|
        [box_result[0], box_result[2], Gem::Version.new(box_result[1])]
      end
      results
    end
This returns an array of all the boxes on the system, given by
 their name and their provider.

 @return [Array] Array of `[name, version, provider]` of the boxes
   installed on this system.