learn-test 3.2.1 → 3.3.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'git'
4
- require 'logger'
5
-
6
- module LearnTest
7
- module GitWip
8
- class << self
9
- def run!(log: false)
10
- git = Git.open('./', log: log)
11
- working_branch = git.current_branch
12
-
13
- commands = [
14
- 'learn-test-wip save "Automatic test submission" --editor',
15
- "git push origin wip/#{working_branch}:refs/heads/wip"
16
- ].join(';')
17
-
18
- Open3.popen3(commands) do |_stdin, _stdout, _stderr, wait_thr|
19
- # while out = stdout.gets do; puts out; end
20
- # while err = stderr.gets do; puts err; end
21
-
22
- if wait_thr.value.exitstatus.zero?
23
- git.config['remote.origin.url'].gsub('.git', '/tree/wip')
24
- else
25
- # puts 'There was an error running learn-test-wip'
26
- false
27
- end
28
- end
29
- rescue StandardError => e
30
- false
31
- end
32
- end
33
- end
34
- end