codersdojo 1.4.05 → 1.4.06

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ require 'zip/zip'
2
+ require 'zip/zipfilesystem'
3
+
4
+ class SessionZipper
5
+
6
+ def compress(path)
7
+ path.sub!(%r[/$],'')
8
+ archive = File.join(path,File.basename(path))+'.zip'
9
+ FileUtils.rm archive, :force=>true
10
+
11
+ Zip::ZipFile.open(archive, 'w') do |zipfile|
12
+ Dir["#{path}/**/**"].reject{|f|f==archive}.each do |file|
13
+ zipfile.add(file.sub(path+'/',''),file)
14
+ end
15
+ end
16
+ archive
17
+ end
18
+
19
+ end
20
+
21
+ SessionZipper.new.compress ".codersdojo/broken"
data/app/shell_wrapper.rb CHANGED
@@ -42,7 +42,7 @@ class ShellWrapper
42
42
  spec_pipe = IO.popen("#{command} #{redirect_stderr_to_stdout}", "r")
43
43
  process.output = spec_pipe.read MAX_STDOUT_LENGTH
44
44
  spec_pipe.close
45
- process.return_code = $?
45
+ process.return_code = $?.exitstatus
46
46
  puts process.output unless process.output.nil?
47
47
  process
48
48
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 4
8
- - 5
9
- version: 1.4.05
8
+ - 6
9
+ version: 1.4.06
10
10
  platform: ruby
11
11
  authors:
12
12
  - CodersDojo-Team
@@ -100,6 +100,7 @@ files:
100
100
  - app/scaffolder.rb
101
101
  - app/scheduler.rb
102
102
  - app/session_id_generator.rb
103
+ - app/session_zipper.rb
103
104
  - app/shell_argument_exception.rb
104
105
  - app/shell_process.rb
105
106
  - app/shell_wrapper.rb