Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Creating folder and uploading script #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions class2016/c6_7/A_22_Radoslav_Kostadinov/exec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
puts "hello"
24 changes: 24 additions & 0 deletions class2016/c6_7/A_22_Radoslav_Kostadinov/executing.rb
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions class2016/c6_7/A_22_Radoslav_Kostadinov/readme.txt
Original file line number Diff line number Diff line change
@@ -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