#!/usr/bin/ruby require 'tmpdir' require 'fileutils' require_relative '../lib/rubyfromexcel' spreadsheet = File.absolute_path(ARGV[0]) ruby_version = File.absolute_path(ARGV[1] || "#{File.basename(ARGV[0],".*")}-ruby") unzipped_spreadsheet = Dir.mktmpdir # The spreadsheet needs to be unzipped before starting puts `unzip -uo #{spreadsheet} -d #{unzipped_spreadsheet}` RubyFromExcel::Process.new do self.source_excel_directory = unzipped_spreadsheet self.target_ruby_directory = ruby_version if ARGV[2] self.checkpoint_directory = File.absolute_path(ARGV[2]) end end.start!(ARGV[3] ? ARGV[3].to_i : nil) FileUtils.rm_rf(unzipped_spreadsheet)