diff --git a/class2016/c6_7/A_22_Radoslav_Kostadinov/exec.rb b/class2016/c6_7/A_22_Radoslav_Kostadinov/exec.rb new file mode 100644 index 0000000..bbad01b --- /dev/null +++ b/class2016/c6_7/A_22_Radoslav_Kostadinov/exec.rb @@ -0,0 +1 @@ +puts "hello" diff --git a/class2016/c6_7/A_22_Radoslav_Kostadinov/executing.rb b/class2016/c6_7/A_22_Radoslav_Kostadinov/executing.rb new file mode 100644 index 0000000..d854660 --- /dev/null +++ b/class2016/c6_7/A_22_Radoslav_Kostadinov/executing.rb @@ -0,0 +1,24 @@ +exam = ARGV[0] +$extract_dir = "#{exam}/../extracted" + + +def extract_files(folder) + Dir.foreach(folder) do |file| + ext = File.extname(file) + if ext == ".gz" + output = `tar -xvzf #{folder}/#{file} -C #{$extract_dir}` + puts output + elsif ext ==".zip" + output = `unzip #{folder}/#{file} -d #{$extract_dir}` + puts output + elsif ext == ".rar" + output =`unrar #{folder}/#{file} -d #{$extract_dir}` + puts output + + end + end +end + +# puts "tar -xvzf #{exam}/asd -C #{$extract_dir}" + + extract_files(exam) \ No newline at end of file diff --git a/class2016/c6_7/A_22_Radoslav_Kostadinov/readme.txt b/class2016/c6_7/A_22_Radoslav_Kostadinov/readme.txt new file mode 100644 index 0000000..3412204 --- /dev/null +++ b/class2016/c6_7/A_22_Radoslav_Kostadinov/readme.txt @@ -0,0 +1,2 @@ +1. Iterate folder and extract all the files +2. For each person execute all the sql files and try to compare the results somehow