Sha256: e123b5647bbb78a9e707190a4ad5026cb893b425e2bc228cd5213bc1e87f09e2

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

module VagrantMutate
  module Box
    class Box

      attr_reader :name, :dir, :provider_name, :supported_input, :supported_output, :image_format, :image_name

      def initialize(env, name, dir)
        @env = env
        @name = name
        @dir = dir
        @logger = Log4r::Logger.new('vagrant::mutate')
      end

      def virtual_size
        input_file = File.join( @dir, @image_name )
        info = `qemu-img info #{input_file}`
        @logger.debug "qemu-img info output\n#{info}"
        if info =~ /(\d+) bytes/
          return $1
        else
          raise Errors::DetermineImageSizeFailed
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-mutate-0.2.1 lib/vagrant-mutate/box/box.rb
vagrant-mutate-0.2.0 lib/vagrant-mutate/box/box.rb
vagrant-mutate-0.1.5 lib/vagrant-mutate/box/box.rb
vagrant-mutate-0.1.4 lib/vagrant-mutate/box/box.rb