retest 2.0.0.pre1 → 2.0.0.pre2
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/exe/retest +4 -12
- data/lib/retest/program.rb +17 -0
- data/lib/retest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09eb72dbc99fae984bbd2d445461bc8f6cb16fd68c2f176a510dab1836e2f93a'
|
4
|
+
data.tar.gz: ff5d41621be25bb672f4167804b5e443924a55b87836baa8a49f603eebab0688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 403fb9d6050a23b540868ccb1bd2c2f98f2851ff18a0549efccfe1ba78f90e7c3593937dfc4aba0f7df51195c1c3022cf70175b1d593e6a3a63baf3fba440584
|
7
|
+
data.tar.gz: e75d88c1b43ed89afc25673be7a913c3f4156f6e3259584d470f0f757810c7a73e934d94a0087e56643d246830cdc130f18340a62eb24afcbb75bb10fd028a36
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
retest (2.0.0.
|
4
|
+
retest (2.0.0.pre2)
|
5
5
|
listen (~> 3.9)
|
6
6
|
observer (~> 0.1)
|
7
7
|
string-similarity (~> 2.1)
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
13
|
byebug (11.1.3)
|
14
|
-
ffi (1.
|
14
|
+
ffi (1.17.0)
|
15
15
|
listen (3.9.0)
|
16
16
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
17
17
|
rb-inotify (~> 0.9, >= 0.9.10)
|
data/exe/retest
CHANGED
@@ -47,9 +47,7 @@ program = Retest::Program.new(
|
|
47
47
|
)
|
48
48
|
|
49
49
|
if options.params[:diff]
|
50
|
-
|
51
|
-
runner.command_stdin = $stdin
|
52
|
-
program.diff(options.params[:diff])
|
50
|
+
program.run_synchronously { program.diff(options.params[:diff]) }
|
53
51
|
return
|
54
52
|
end
|
55
53
|
|
@@ -112,19 +110,13 @@ loop do
|
|
112
110
|
when 'e', 'exit'
|
113
111
|
Process.kill("INT", 0)
|
114
112
|
when ''
|
115
|
-
|
116
|
-
|
117
|
-
old_stdin = runner.command_stdin
|
118
|
-
runner.command_stdin = $stdin
|
119
|
-
runner.run(nil, repository: repository)
|
120
|
-
ensure
|
121
|
-
runner.command_stdin = old_stdin
|
122
|
-
end
|
113
|
+
puts "Running last command\n"
|
114
|
+
program.run_synchronously { runner.run(nil, repository: repository) }
|
123
115
|
when 'ra', 'run all'
|
124
116
|
puts "Running all tests\n"
|
125
117
|
all_test_runner.run
|
126
118
|
when /^di?f?f?\s(.*)$/
|
127
|
-
program.diff($1)
|
119
|
+
program.run_synchronously { program.diff($1) }
|
128
120
|
when 'h', 'help'
|
129
121
|
puts <<~HELP
|
130
122
|
|
data/lib/retest/program.rb
CHANGED
@@ -35,6 +35,23 @@ module Retest
|
|
35
35
|
runner.run_all_tests command.format_batch(*test_files)
|
36
36
|
end
|
37
37
|
|
38
|
+
def run_synchronously(runner: @runner, prompt: @repository.prompt)
|
39
|
+
raise ArgumentError, 'need a block' unless block_given?
|
40
|
+
|
41
|
+
begin
|
42
|
+
pause
|
43
|
+
old_command_stdin = runner.command_stdin
|
44
|
+
old_prompt_stdin = prompt.input
|
45
|
+
prompt.input = $stdin
|
46
|
+
runner.command_stdin = $stdin
|
47
|
+
yield
|
48
|
+
ensure
|
49
|
+
resume
|
50
|
+
runner.command_stdin = old_command_stdin
|
51
|
+
prompt.input = old_prompt_stdin
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
38
55
|
private
|
39
56
|
|
40
57
|
def clear_terminal
|
data/lib/retest/version.rb
CHANGED