-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautocomplete-mri.rb
More file actions
56 lines (47 loc) · 931 Bytes
/
autocomplete-mri.rb
File metadata and controls
56 lines (47 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'fileutils'
test = <<-TEST
suggestions = $gtk.suggest_autocompletion index: 45, text: <<-S
require 'app/game.rb'
def tick args
args.
args.inputs.keyboard.key_up.backspace
args.gtk.suppress_mailbox = false
$game ||= Game.new
$game.args = args
$game.tick
end
S
$gtk.write_file 'app/autocomplete.txt', suggestions.join("\n")
TEST
begin
`rm -rf ./mailbox-processed/`
rescue
end
begin
`rm ./autocomplete.txt 2> /dev/null`
rescue
end
# FOR TESTING
# begin
# `rm ./mailbox.txt 2> /dev/null`
# rescue
# end
# File.write './mailbox.txt', test
puts "========"
if !File.exist? './mailbox.txt'
else
contents = File.read './mailbox.txt'
`rm ./mailbox.txt`
File.write './mailbox.rb', contents
timeout = 480
while timeout > 0
sleep 0.001
timeout -= 1
if File.exist? './autocomplete.txt'
puts (File.read './autocomplete.txt')
timeout = 0
end
end
end
puts "========"
puts "done"