Sha256: 62b338385e4465eaac19108a95006565c77dac3936bd98ea6f47f1f45b99ca5a

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

module Veewee
  module Provider
    module Core
      module BoxCommand
        def create_floppy(filename)
          # Todo Check for java
          # Todo check output of commands

          # Check for floppy
          unless definition.floppy_files.nil?
            require 'tmpdir'
            temp_dir=Dir.mktmpdir
            definition.floppy_files.each do |filename|
              full_filename=full_filename=File.join(definition.path,filename)
              FileUtils.cp("#{full_filename}","#{temp_dir}")
            end
            javacode_dir=File.expand_path(File.join(__FILE__,'..','..','..','..','..','java'))
            floppy_file=File.join(definition.path,filename)
            if File.exists?(floppy_file)
              env.logger.info "Removing previous floppy file"
              FileUtils.rm(floppy_file)
            end
            command="java -jar #{javacode_dir}/dir2floppy.jar '#{temp_dir}' '#{floppy_file}'"
            shell_exec("#{command}")
          end
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veewee-0.3.0.alpha8 lib/veewee/provider/core/box/floppy.rb
veewee-0.3.0.alpha7 lib/veewee/provider/core/box/floppy.rb
veewee-0.3.0.alpha6 lib/veewee/provider/core/box/floppy.rb
veewee-0.3.0.alpha5 lib/veewee/provider/core/box/floppy.rb