themigrator 0.1.16 → 0.1.17
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/lib/themigrator/migrator.rb +1 -1
- data/lib/themigrator/ui.rb +19 -8
- data/lib/themigrator/ui/getchar.rb +3 -2
- data/lib/themigrator/ui/log_area.rb +2 -2
- data/lib/themigrator/ui/progress_window.rb +0 -1
- data/lib/themigrator/ui/title_bar.rb +8 -0
- data/lib/themigrator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986992dd32eefaeded344d5ae323a53dff537b4d
|
4
|
+
data.tar.gz: ac6e6168850a5cb8918908126cfe47c4217dee2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 845509ce6a558b8525d12589ef26e1d5d520d52a3a51b658b744277d3735cb623358053389e3019c25fdd7874460c9588f41a6de473cb3283a50233710654e6d
|
7
|
+
data.tar.gz: 6ea768b08ec3dd42e7fa4f1831eb220566ad91f5f13664a8d1965e106e7d4f07e8a711e2fb55e01b5b68645ca6c595f2cc9bfb42d4bb06df03946febca8519e2
|
data/lib/themigrator/migrator.rb
CHANGED
data/lib/themigrator/ui.rb
CHANGED
@@ -24,6 +24,8 @@ module Themigrator
|
|
24
24
|
@pm = progress_monitor
|
25
25
|
@roles = []
|
26
26
|
@current_action = ''
|
27
|
+
|
28
|
+
trap "WINCH", ->(_) { resize }
|
27
29
|
end
|
28
30
|
|
29
31
|
def start
|
@@ -36,6 +38,19 @@ module Themigrator
|
|
36
38
|
|
37
39
|
private
|
38
40
|
|
41
|
+
def get_size
|
42
|
+
@cols = cols
|
43
|
+
@lines = lines
|
44
|
+
end
|
45
|
+
|
46
|
+
def resize
|
47
|
+
get_size
|
48
|
+
end
|
49
|
+
|
50
|
+
def redraw
|
51
|
+
|
52
|
+
end
|
53
|
+
|
39
54
|
def render_loop
|
40
55
|
loop do
|
41
56
|
sleep ENV['SLEEP'] ? ENV['SLEEP'].to_f : 0.2
|
@@ -54,12 +69,10 @@ module Themigrator
|
|
54
69
|
next_action
|
55
70
|
when :c_c, 'q'
|
56
71
|
exit 0
|
57
|
-
when :npage
|
72
|
+
when :npage,:down
|
58
73
|
la_npage
|
59
|
-
|
60
|
-
when :ppage
|
74
|
+
when :ppage,:up
|
61
75
|
la_ppage
|
62
|
-
say 'previous_page'
|
63
76
|
else
|
64
77
|
keys.unshift(e)
|
65
78
|
say keys.map(&:inspect).join(' ')
|
@@ -143,7 +156,6 @@ module Themigrator
|
|
143
156
|
end
|
144
157
|
|
145
158
|
def init_screen
|
146
|
-
super
|
147
159
|
# crmode
|
148
160
|
# cbreak
|
149
161
|
raw
|
@@ -151,13 +163,12 @@ module Themigrator
|
|
151
163
|
noecho
|
152
164
|
curs_set(0)
|
153
165
|
ObjectSpace.define_finalizer(self, proc do
|
154
|
-
|
166
|
+
close_screen
|
155
167
|
end)
|
168
|
+
get_size
|
156
169
|
end
|
157
170
|
|
158
171
|
def render
|
159
|
-
@cols = cols
|
160
|
-
@lines = lines
|
161
172
|
la_render if la_initialize?
|
162
173
|
render_title
|
163
174
|
render_progress
|
@@ -12,8 +12,8 @@ module Themigrator
|
|
12
12
|
KEY2SYM["\e[6~"] = :npage
|
13
13
|
KEY2SYM["\e[5~"] = :ppage
|
14
14
|
KEY2SYM["\u0003"] = :c_c
|
15
|
-
KEY2SYM["\e[B"] = :
|
16
|
-
KEY2SYM["\e[A"] = :
|
15
|
+
KEY2SYM["\e[B"] = :down
|
16
|
+
KEY2SYM["\e[A"] = :up
|
17
17
|
|
18
18
|
def getchar
|
19
19
|
begin
|
@@ -39,3 +39,4 @@ module Themigrator
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
@@ -127,11 +127,11 @@ module Themigrator
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def la_npage
|
130
|
-
la_each_window
|
130
|
+
la_each_window { |w,_role| w.nextpage }
|
131
131
|
end
|
132
132
|
|
133
133
|
def la_ppage
|
134
|
-
la_each_window
|
134
|
+
la_each_window { |w,_role| w.prevpage }
|
135
135
|
end
|
136
136
|
|
137
137
|
def la_switch_action(action)
|
@@ -11,6 +11,14 @@ module Themigrator
|
|
11
11
|
time_window.setpos(0, 0)
|
12
12
|
time_window.addstr(now_str)
|
13
13
|
time_window.refresh
|
14
|
+
title_window.attrset(A_BOLD)
|
15
|
+
title_window.setpos(0,0)
|
16
|
+
title_window.addstr("The migrator")
|
17
|
+
title_window.attrset(A_NORMAL)
|
18
|
+
dir = Dir.pwd
|
19
|
+
project = File.basename dir
|
20
|
+
title_window.addstr(" #{project}")
|
21
|
+
title_window.refresh
|
14
22
|
end
|
15
23
|
|
16
24
|
def title_window
|
data/lib/themigrator/version.rb
CHANGED