modsvaskr 0.1.2 → 0.1.7

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: 759a86a5ea5ddbba8ed9bcf56ece81b83324dca028af137e2bf948402f5900ad
4
- data.tar.gz: 596259ae4f2e3904ac555eef656bd6be5f7ab18047fc87ba50263978f67a5f5d
3
+ metadata.gz: fd6d0c139d7abd4ebc630cb1704182149bfae4213fa5bf44d8befee491c87606
4
+ data.tar.gz: 4f5c1ef541e86c57093ac8633190fd473aa61d66cfff5d4454d5db691f570f03
5
5
  SHA512:
6
- metadata.gz: 37902323f88d35bcdf80abb62a1e1c14d8db78dd4ecf37aa0d0a8afabba6b17fad5f653863f5f08f9a5309665bef39838ad120315919f7dca1b9a01de185ef3b
7
- data.tar.gz: a24f76d9bb884fde1e1046b28e5082da0cfc451767c272a5e70eb22a0b203d211b08f92cdec173eafbbbae07b842c27f63dfb63f94fde5827ca280e5bfb2e0de
6
+ metadata.gz: 112d6f09e79b130dd9db2b561848dbabdbd3e771faf791d71b54a53ac09bb8928d70f6f50c0e1586689ad3519b7795e6fe16e980d3f3340da83aa702a4f0300d
7
+ data.tar.gz: b5531b0ecadc34ad551e874a2ac26b7a21a7698a5ceed70f9d182e32c94beb2943eb7e58d73c5004994f9c358ff207a7b94af02c12a30b866287e564414f0cba
@@ -3,6 +3,7 @@ require 'elder_scrolls_plugin'
3
3
  require 'fileutils'
4
4
  require 'json'
5
5
  require 'time'
6
+ require 'timeout'
6
7
  require 'modsvaskr/tests_suite'
7
8
 
8
9
  module Modsvaskr
@@ -66,8 +67,14 @@ module Modsvaskr
66
67
  }
67
68
  )
68
69
  )
69
- # Clear the AutoTest test statuses
70
- File.unlink("#{@game.path}/Data/SKSE/Plugins/StorageUtilData/AutoTest_#{tests_suite}_Statuses.json") if File.exist?("#{@game.path}/Data/SKSE/Plugins/StorageUtilData/AutoTest_#{tests_suite}_Statuses.json")
70
+ # Clear the AutoTest test statuses that we are going to run
71
+ statuses_file = "#{@game.path}/Data/SKSE/Plugins/StorageUtilData/AutoTest_#{tests_suite}_Statuses.json"
72
+ if File.exist?(statuses_file)
73
+ File.write(
74
+ statuses_file,
75
+ JSON.pretty_generate('string' => JSON.parse(File.read(statuses_file))['string'].delete_if { |test_name, _test_status| tests.include?(test_name) })
76
+ )
77
+ end
71
78
  end
72
79
  auto_test_config_file = "#{@game.path}/Data/SKSE/Plugins/StorageUtilData/AutoTest_Config.json"
73
80
  # Write the JSON file that contains the configuration of the AutoTest tests runner
@@ -204,21 +211,23 @@ module Modsvaskr
204
211
  end
205
212
  end
206
213
  # We will start again. Leave some time to interrupt if we want.
207
- unless @config.no_prompt
214
+ if @config.no_prompt
215
+ out 'Start again automatically as no_prompt has been set.'
216
+ else
208
217
  # First, flush stdin of any pending character
209
218
  $stdin.getc while !select([$stdin], nil, nil, 2).nil?
210
- end
211
- out "We are going to start again in #{@game.timeout_interrupt_tests_secs} seconds. Press Enter now to interrupt it."
212
- key_pressed =
213
- begin
214
- Timeout.timeout(@game.timeout_interrupt_tests_secs) { $stdin.gets }
215
- rescue
216
- nil
219
+ out "We are going to start again in #{@game.timeout_interrupt_tests_secs} seconds. Press Enter now to interrupt it."
220
+ key_pressed =
221
+ begin
222
+ Timeout.timeout(@game.timeout_interrupt_tests_secs) { $stdin.gets }
223
+ rescue Timeout::Error
224
+ nil
225
+ end
226
+ if key_pressed
227
+ log "[ In-game testing #{@game.name} ] - Run interrupted by user."
228
+ # TODO: Remove AutoTest start on load: it has been interrupted by the user, so we should not keep it in case the user launches the game by itself.
229
+ break
217
230
  end
218
- if key_pressed
219
- log "[ In-game testing #{@game.name} ] - Run interrupted by user."
220
- # TODO: Remove AutoTest start on load: it has been interrupted by the user, so we should not keep it in case the user launches the game by itself.
221
- break
222
231
  end
223
232
  end
224
233
  end
@@ -131,14 +131,15 @@ module Modsvaskr
131
131
  in_game_tests.each do |tests_suite, selected_tests|
132
132
  in_game_tests_to_subscribe = @tests_suites[tests_suite].in_game_tests_for(selected_tests)
133
133
  in_game_tests_to_subscribe.each do |in_game_tests_suite, selected_in_game_tests|
134
+ selected_in_game_tests_downcase = selected_in_game_tests.map(&:downcase)
134
135
  in_game_tests_subscriptions[in_game_tests_suite] = [] unless in_game_tests_subscriptions.key?(in_game_tests_suite)
135
136
  in_game_tests_subscriptions[in_game_tests_suite] << {
136
137
  tests_suite: tests_suite,
137
- in_game_tests: selected_in_game_tests,
138
+ in_game_tests: selected_in_game_tests_downcase,
138
139
  selected_tests: selected_tests
139
140
  }
140
141
  merged_in_game_tests[in_game_tests_suite] = [] unless merged_in_game_tests.key?(in_game_tests_suite)
141
- merged_in_game_tests[in_game_tests_suite] = (merged_in_game_tests[in_game_tests_suite] + selected_in_game_tests).uniq
142
+ merged_in_game_tests[in_game_tests_suite] = (merged_in_game_tests[in_game_tests_suite] + selected_in_game_tests_downcase).uniq
142
143
  end
143
144
  end
144
145
  in_game_tests_runner = InGameTestsRunner.new(@config, @game)
@@ -1,5 +1,5 @@
1
1
  module Modsvaskr
2
2
 
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.7'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modsvaskr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses_menu