learn-test 3.2.3 → 3.3.0.pre.4

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.
@@ -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