Class: HomeWorkChecker::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/hw_checker/base.rb

Class Method Summary collapse

Class Method Details

.start(work_path, tmp_path, name, type) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/hw_checker/base.rb', line 3

def self.start(work_path, tmp_path, name, type)
  `rm -r #{tmp_path}/#{name}` if Dir.exist?("#{tmp_path}/#{name}")
  time_start, xml_content = Time.now, {} 
  Unarchive::Zip.new("#{work_path}/#{name+type}", tmp_path)
  stat = TestRunStat::execute(work_path, tmp_path, name)
  stat << (Time.now - time_start).round(2)

  File.open("#{work_path}/#{name}-result.xml", 'w') do |file| 
    file.write(generate_xml_content(name, stat) )
  end
end