retest 2.0.0.pre1 → 2.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8aa95d85d566c3271485de99e777fe77a8821e29a06332752ac5e9e4b3dcc7aa
4
- data.tar.gz: 812a2acebb89af6544afbbb26b56f81c62c9cd5ef2cf41dd5b39f1a0d5f8c1b6
3
+ metadata.gz: '09eb72dbc99fae984bbd2d445461bc8f6cb16fd68c2f176a510dab1836e2f93a'
4
+ data.tar.gz: ff5d41621be25bb672f4167804b5e443924a55b87836baa8a49f603eebab0688
5
5
  SHA512:
6
- metadata.gz: d4e43b8ad34890700ff78ab2d66a594e102f23ff8144c3dc55a50b2a850b5ea6cbe8a09707348983e7518387e15759f972cb52275b7e3e94f47b4fd1a52ccf06
7
- data.tar.gz: 7e51d2fd6ffcb78ca8739fb703a71161c84eb5ee3f3f4cd1b406bc7c364d92f04d077c720b4c94ead0faa0393df2209051a5abcaac86bed64e5b7ad091a76b7e
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.pre1)
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.16.3)
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
- prompt.input = $stdin
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
- begin
116
- puts "Running last command\n"
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Retest
2
- VERSION = "2.0.0.pre1"
2
+ VERSION = "2.0.0.pre2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retest
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre1
4
+ version: 2.0.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Barret